arun velagapalli:<asp:FormParameter Name ="usrname1" FormField="Label1" />
Hi friend,
It seems that you do not know the correct way to use 'asp:FormParament' , here is an artilce will show you the right way,
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.formparameter.aspx
<asp:sqldatasource
id="SqlDataSource1"
runat="server"
connectionstring="<%$ ConnectionStrings:MyNorthwind %>"
selectcommand="SELECT CompanyName,ShipperID FROM Shippers"
insertcommand="INSERT INTO Shippers (CompanyName,Phone) VALUES (@CoName,@Phone)">
<insertparameters>
<asp:formparameter name="CoName" formfield="CompanyNameBox" />
<asp:formparameter name="Phone" formfield="PhoneBox" />
</insertparameters>
</asp:sqldatasource>
<br /><asp:textbox
id="CompanyNameBox"
runat="server" />
<asp:RequiredFieldValidator
id="RequiredFieldValidator1"
runat="server"
ControlToValidate="CompanyNameBox"
Display="Static"
ErrorMessage="Please enter a company name." />
<br /><asp:textbox
id="PhoneBox"
runat="server" />
<asp:RequiredFieldValidator
id="RequiredFieldValidator2"
runat="server"
ControlToValidate="PhoneBox"
Display="Static"
ErrorMessage="Please enter a phone number." />
and please attention more on the following lines,
1. insertcommand="INSERT INTO Shippers (CompanyName,Phone) VALUES (@CoName,@Phone)">
2. <asp:formparameter name="CoName" formfield="CompanyNameBox" />
3. <asp:textbox id="CompanyNameBox" runat="server" />
Line 1 tell us that the command need two parameters, they are "CoName" and "Phone";
Line 2 tell us that parameter of "CoName" will bind to a web control which the ID is assigned "CompanyhNameBox" ;
Line 3 tell us that parameter bind control is a TextBox control.