Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 13, 2012 08:30 AM by Frank Jiang - MSFT
Participant
1252 Points
1896 Posts
Apr 11, 2012 12:09 AM|LINK
I am trying to create an updateparameter with the following code in vb codebehind.
Dim strTest as string = "abcdefgh"
SqlDataSource1.UpdateParameters.Add("SOURCEMEMO1", TypeCode.string, strTest)
I get an error saying that abcdefgh is not the name of a column. Where is that coming from. it is supposed to be the value for the parameter "SourceMemo1"
Member
217 Points
40 Posts
Apr 11, 2012 01:30 PM|LINK
Have you tried to remove TypeCode.String to see what happens.
SqlDataSource1.UpdateParameters.Add("SOURCEMEMO1", strTest)
All-Star
16006 Points
1728 Posts
Microsoft
Apr 13, 2012 08:30 AM|LINK
Try this:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"> <UpdateParameters> <asp:Parameter Name="SOURCEMEMO1" Type="String" /> </UpdateParameters> </asp:SqlDataSource>
Then
SqlDataSource1.UpdateParameters["SOURCEMEMO1"].DefaultValue = "abcdefgh";
JAYHAWKER
Participant
1252 Points
1896 Posts
I am trying to add updateparameters in codebehind for a listview but get errors, what am I doing ...
Apr 11, 2012 12:09 AM|LINK
I am trying to create an updateparameter with the following code in vb codebehind.
Dim strTest as string = "abcdefgh"
SqlDataSource1.UpdateParameters.Add("SOURCEMEMO1", TypeCode.string, strTest)
I get an error saying that abcdefgh is not the name of a column. Where is that coming from. it is supposed to be the value for the parameter "SourceMemo1"
cornboy88
Member
217 Points
40 Posts
Re: I am trying to add updateparameters in codebehind for a listview but get errors, what am I do...
Apr 11, 2012 01:30 PM|LINK
Have you tried to remove TypeCode.String to see what happens.
SqlDataSource1.UpdateParameters.Add("SOURCEMEMO1", strTest)
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: I am trying to add updateparameters in codebehind for a listview but get errors, what am I do...
Apr 13, 2012 08:30 AM|LINK
Try this:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"> <UpdateParameters> <asp:Parameter Name="SOURCEMEMO1" Type="String" /> </UpdateParameters> </asp:SqlDataSource>Then
SqlDataSource1.UpdateParameters["SOURCEMEMO1"].DefaultValue = "abcdefgh";
Feedback to us
Develop and promote your apps in Windows Store