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
Asked
Active
Viewed 1,538 times
0
-
I think you should spend some time [here](http://www.connectionstrings.com/) – V4Vendetta Jul 06 '11 at 05:37
-
1Is that an assignment for all of us? :P – FIre Panda Jul 06 '11 at 05:38
2 Answers
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