I am building a web usercontrol, the user control has a grid which is bound to a SQLDatasource at runtime.
The grid on usercontrol allows binding to database Table specified by the user at runtime and the columns are generated at runtime.
I have managed to generated the insert,delete,update command and parameters at runtime, but once the page is rendered for some strange reason the SQLDatasource insert,delete,update command becomes blank.
any ideas guys?????
What I have tried:
SqlDSGridDetail.UpdateCommandType = SqlDataSourceCommandType.Text;
SqlDSGridDetail.UpdateCommand = "update table set col =@col where col1 =@col1";
SqlDSGridDetail.InsertCommandType = SqlDataSourceCommandType.Text;
SqlDSGridDetail.InsertCommand = "insert into table(col) values (@col)=@col1";