...hope some body can help me resolve the problem....where i have to update a particular data ,
the datas are retreived from the db using a dropdownlist,selected data are updated inside a textbox...........
.....where there are constraints set by validators
for space and !^#$%&*^----charaecters:
My problm is data is not updated,please help me
Code:(Asp.net C#---Sql server db)
private void btedit_Click(object sender, System.EventArgs e)
{
LabErr.Text="";
if(Page.IsValid==true)
{
SqlConnection con1=new SqlConnection(@"Server=sqloledb.1;User ID=sa;password=;Data Source=IRID_BDC1;Initial Catalog=newbie");
con1.Open();
SqlCommand cmd=new SqlCommand("Update Loc_mast Set Loc =('"+ txtrnme.Text+"') Where Loc =('"+ Droploc.SelectedItem.Text+"')",con1);
cmd.ExecuteNonQuery();
}
else
{
//txtrnme.Text="";
LabErr.Text="Please try Again";
}
..please suggest a soln..........
ICHU