FileUpload + string!!
-
What's the SQL of the
AccessDataSource1.InsertCommand
? Does it get the correct parameters?I are Troll :suss:
-
You got it working you said? The "Accessdatasource1"-control should have a property called "InsertCommand". That property holds an
INSERT
statement, in Sql-syntax. Since you said that the variables contain the correct value, I'm guessing that it must go wrong when writing to the database. That's the task of the Accessdatasource, hence we'd want to check that next :)I are Troll :suss:
-
You got it working you said? The "Accessdatasource1"-control should have a property called "InsertCommand". That property holds an
INSERT
statement, in Sql-syntax. Since you said that the variables contain the correct value, I'm guessing that it must go wrong when writing to the database. That's the task of the Accessdatasource, hence we'd want to check that next :)I are Troll :suss:
this is my insercommand
InsertCommand="INSERT INTO [gallery] ([file], [about]) VALUES (?, ?)"
and my insertparameters
<InsertParameters>
<asp:controlParameter Name="file" Type="String" ControlID="FileUpload1" PropertyName="FileName"/>
<asp:controlParameter Name="about" Type="String" ControlID="txtBoxAbout" PropertyName="text" />
</InsertParameters>what do u think i should do or add? thanks
-
You got it working you said? The "Accessdatasource1"-control should have a property called "InsertCommand". That property holds an
INSERT
statement, in Sql-syntax. Since you said that the variables contain the correct value, I'm guessing that it must go wrong when writing to the database. That's the task of the Accessdatasource, hence we'd want to check that next :)I are Troll :suss:
-
How about pointing the parameter to that label?
<asp:controlParameter Name="about" Type="String" ControlID="txtBoxAbout" PropertyName="text" />
Now, when you click the button, update the label first;
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string imagefolder = "photo";
string savepath;
string savefile;
Label3.Text = "Bla" + System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);Does that fix it?
I are Troll :suss:
-
How about pointing the parameter to that label?
<asp:controlParameter Name="about" Type="String" ControlID="txtBoxAbout" PropertyName="text" />
Now, when you click the button, update the label first;
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string imagefolder = "photo";
string savepath;
string savefile;
Label3.Text = "Bla" + System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);Does that fix it?
I are Troll :suss:
-
it didnt work. i also tried using the $ sign - ControlID="Label3$FileUpload1" and added <asp:ControlParameter Name="pre" Type="string" ControlID="Label3" PropertyName="text" /> still not working. this is driving me crazy.
The idea was to point the parameter to the label; the
Name
should point to the parameter-name (that's "file", from your Sql statement), theControlId
should point to the control that you're binding the parameter to. TheLabel
displays it's contents in aText
property, hence the binding;<asp:ControlParameter ControlID="Label3" Name="file" PropertyName="Text" Type="String" />
Does the value of the label get set correctly?
I are Troll :suss:
-
The idea was to point the parameter to the label; the
Name
should point to the parameter-name (that's "file", from your Sql statement), theControlId
should point to the control that you're binding the parameter to. TheLabel
displays it's contents in aText
property, hence the binding;<asp:ControlParameter ControlID="Label3" Name="file" PropertyName="Text" Type="String" />
Does the value of the label get set correctly?
I are Troll :suss:
-
don-basil wrote:
this didnt fix it. Any other ideas?
I'm out of idea's, maybe one of the ASP.NET guru's can help out :(
I are Troll :suss: