如何将值插入存储过程 [英] How Can I Insert Values Into Stored Procedure

查看:87
本文介绍了如何将值插入存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 SqlCommand Command = new SqlCommand( 插入位置值(@loc, @reg,_ _ c); 
Command.Parameters.AddWithValue( @ loc,txtloc。文本);
Command.Parameters.AddWithValue( @ reg,txtreg。 Text );
_con。打开();
Command.ExecuteNonQuery();
_con。关闭();



i有位置表,我正在插入两个值init

它显示@reg附近的语法不正确



i找不到我所做的错误...........

提前谢谢..

解决方案

< blockquote>你错过了')'



Systax错误:

  insert   into  location  values  @ loc  @ REG   


SqlCommand Command = new SqlCommand("insert into location values (@loc,@reg", _con);
            Command.Parameters.AddWithValue("@loc", txtloc.Text);
            Command.Parameters.AddWithValue("@reg", txtreg.Text);
            _con.Open();
            Command.ExecuteNonQuery();
            _con.Close();


i have location table and i'm inserting two values init
it shows that incorrect syntax near @reg

i can't find the mistake where i have done...........
thanks in advance..

解决方案

You have missed ')'

Systax Error :

insert into location values (@loc,@reg)


这篇关于如何将值插入存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆