0

Im using Visual Studio 2008 . and wants to connect to database. My Application (in C#) is to develop a form acts like Image Viewer and to perform insert an image and delete an image , Also To Display the images In Database

user829222
  • 75
  • 1
  • 12

2 Answers2

3

Refer this walkthrough:

http://msdn.microsoft.com/en-us/library/tzedkwye%28v=VS.80%29.aspx

Mamta D
  • 6,310
  • 3
  • 27
  • 41
0

Assuming that your DBMS is Sql server. You could do for example

SqlConnection conn = new SqlConnection("connString here");//conn string here
conn.Open();//if using SqlDataReader
SqlCommand cmd = new SqlCommand("your query", conn);///your command object
....
.....

In order to insert the image to the database, there are mainly two options, either to save the image path in the database or save the image itself in database as BLOB.

FIre Panda
  • 6,537
  • 2
  • 25
  • 38