|
-
Nov 5th, 2002, 12:32 PM
#1
Thread Starter
Addicted Member
Saving an Image to a SQL server db
Hi there,
I have an asp.net page that generates an image based on a bunch of user input provided through the page. Once the image is generated it dislays it up on the webpage as a url source (as the image is created on a seperate server) I now want to save that image to my sqlserver db, any ideas?
-
Nov 5th, 2002, 02:34 PM
#2
Hyperactive Member
chk if this helps u...
save the path of the image file in the databse and later u can retrieve that image from that path
-
Nov 5th, 2002, 07:01 PM
#3
Thread Starter
Addicted Member
-
Nov 5th, 2002, 08:13 PM
#4
PowerPoster
It's probably safer to store the actual image in a BLOB, depending upon the size of the image.
-
Nov 6th, 2002, 01:52 AM
#5
Thread Starter
Addicted Member
ok assuiming I save the image as a blob in the database, here is some simple code to get a handle on an image, how do I bind it to the image when the only fields I can see to work with are the imageurl?
SqlConnection dbConn = new SqlConnection("data source=localhost;initial catalog=pubs;UID=sa;PWD=;");
string sSqlQuery = "SELECT Logo FROM pub_info WHERE pub_id=0736";
SqlDataAdapter da = new SqlDataAdapter( sSqlQuery,dbConn);
// Load into memory
DataSet ds = new DataSet();
da.Fill( ds );
// Check for data
if( ds.Tables[0].Rows.Count > 0 ) {
????????????????????????????????????????????
Image.ImageUrl(
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|