Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
ArtifactSqlDataSource.InsertParameters["ArtifactId"].DefaultValue = txtID.Text;
ArtifactSqlDataSource.InsertParameters["ArtifactType"].DefaultValue = txtType.Text;
ArtifactSqlDataSource.InsertParameters["DateRange"].DefaultValue = txtDateRange.Text;
ArtifactSqlDataSource.InsertParameters["ProvenienceId"].DefaultValue = ddlProvenience.SelectedValue;
ArtifactSqlDataSource.InsertParameters["ImageFile"].DefaultValue = fuImage.PostedFile.FileName.ToString();

fuImage is the name of the file upload control. All the other items is stored to the database except from the image filename
Posted
Updated 1-May-10 6:46am
v2

omanzo_barrett wrote:
ArtifactSqlDataSource.InsertParameters["ImageFile"].DefaultValue = fuImage.PostedFile.FileName

Looks fine.. what is the issue. You already got the filename from the upload control. You can save the same like other values.

Are you facing any other issue in it?
 
Share this answer
 
yeah thats my problem I cant see why its is not storing in the database, as all the other items are store. The database that I am using is Microsoft SQL Server, I doubt this is a issue

UPDATE SM: Put a breakpoint at that line while in Debug mode and check what are you getting the value. First thing is to confirm if correct value is being set. If so, then try to check in SQL Server profiler what is the query passed to database for data insert. That would help in getting you where exactly the issue lies, if so.
 
Share this answer
 
v2
See Lik below

Link
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900