sql语句中的insert语句的用法

来源:百度知道 编辑:UC知道 时间:2024/09/21 20:27:06
我想把textbox框中的数据插入到数据库当中,用insert语句,但sqlcommand的command.text怎么写

C#写法,其中fields为与textbox对应的字段名,textbox1为textbox的ID
string sql="Insert 表名 fields values " + textbox1.Text;

SqlCommand userCommand=new SqlCommand();
userCommand.text=="instert into 表名 字段名 values ('"textbox.text.toString"');
textbox.text 注意转换相应的类型。

看是什么语言 语言不一样的话格式不一样