seiamerica
Technical User
I get column name, colValue in a string colName from my dataset.
string colName = (da.Tables["Members"].Columns[j].ColumnName.Trim().ToString() ) ;
string colValue = (da.Tables["Members"].Rows.ItemArray.GetValue(j).ToString() ) ;
I need to update my database by setting colvaues to the specified column names.
cmd1.CommandText="Update Test set "+ colName +" = '"+colValue+"' where ID =" 1);
I get syntax error. Can anyone suggest me where I am doing wrong. Any help is greately appreciated.
string colName = (da.Tables["Members"].Columns[j].ColumnName.Trim().ToString() ) ;
string colValue = (da.Tables["Members"].Rows.ItemArray.GetValue(j).ToString() ) ;
I need to update my database by setting colvaues to the specified column names.
cmd1.CommandText="Update Test set "+ colName +" = '"+colValue+"' where ID =" 1);
I get syntax error. Can anyone suggest me where I am doing wrong. Any help is greately appreciated.