1

I have created Formview. and Created Update query and provided parameters manually in SqlDataSource. But I have confusion that how can I provide Source for parameters?

I tried Command and Parameter Editor, but as control I only find Formview2. So, how can I provide source for parameters? Say Source for Param1 = (Formview1.FindControl(textbo1)).text, Param2 =(Formview1.FindControl(textbo2)).text

Thanks.

user1782698
  • 33
  • 1
  • 6

1 Answers1

0

In your code behind you could try something like this

 Dim txtBox as TextBox = Formview1.FindControl("TextBox1").text
 sqlDataSource1.Parameters.Add("@ParameterName", txtBox)

This will manually set your parameter @ParameterName = txtBox. SqlDataSource1 will be your existing datasource that you have already created.

Also see here Cannot Find Control ID in ControlParameter for doing this in the markup

Community
  • 1
  • 1
user3841709
  • 386
  • 6
  • 28