مساء الخيرات لكل الاعضاء الحلوين
انا عملت store procedure في ال sql server وبدي حد يتاكد من الprocedure اذ في غلط؟؟؟؟
ويقولي
وعاوزة كمان اعمله calling او استدعاء عبر الvb.net
انا راح انزل الكود تبع البروسيجر
CREATE PROCEDURE [Doc_Login] @Doc_No[varchar] AS Declare @Userid int insert into login(User_Id,Password,Type) values(@Doc_No,@Doc_No,'D') select @Userid=@@identity update Doctor set <A href="mailto:Login_Id=@Userid">Login_Id=@Userid</A> where <A href="mailto:Doc_No=@Doc_No">Doc_No=@Doc_No</A> commit GO
طبعا البروسيجر بيستقبل واحد متغير فقط وهو رقم الدكتور
اما المتغير الثاني فقط للاستخدام داخل البروسيجر زي ما انتو شايفين
حاولت استدعيه عبر الفيبي دوت نت بس ما قدرت وما يعملش حاجة وكانه ما بيشتغل
الاستدعاء كان هيك
<FONT color=#0000ff size=2><FONT color=#0000ff size=2></P> Dim</FONT><FONT color=#000000 size=2> conStr </FONT><FONT color=#0000ff size=2>As</FONT><FONT color=#000000 size=2> </FONT><FONT color=#0000ff size=2>String</FONT><FONT color=#000000 size=2> = </FONT><FONT color=#800000 size=2>"Data Source=localhost;Initial Catalog=Exam;Integrated Security=True"</P></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> con </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> SqlConnection(conStr)</P></FONT> Dim</FONT><FONT size=2> command </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> SqlCommand = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> SqlCommand(</FONT><FONT color=#800000 size=2>"Doc_Login"</FONT><FONT size=2>, con)</P> command.CommandType = CommandType.StoredProcedure</P><FONT size=2> command.Parameters.Add(</FONT><FONT color=#800000 size=2>"@Doc_No"</FONT><FONT size=2>, SqlDbType.VarChar, 10)</P></FONT><FONT size=2> con.Open()</P></FONT><FONT size=2> command.ExecuteNonQuery()</P> con.Close()</P> MessageBox.Show(</FONT><FONT color=#800000 size=2>"Successfully Added"</FONT><FONT size=2>)</P> </FONT></FONT>