الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

سؤال فى الاستعلام

بدأه shosho842000 في 29 أكتوبر 2009 · 1 رد · 467 مشاهدة · في ADO.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكــم ورحمـة الله وبركاتــه ،،

If cn.State = ConnectionState.Open Then cn.Close()

If TextBox1.Text = "" Then

cn.Open()

cmd.Connection = cn

cmd.CommandType = CommandType.StoredProcedure

cmd.CommandText = "selectall"

tb.Load(cmd.ExecuteReader)

DataGridView1.DataSource = tb

Else

Dim tb2 As New DataTable

cn.Open()

cmd.Connection = cn

cmd.Parameters.Clear()

cmd.CommandType = CommandType.StoredProcedure

cmd.CommandText = "selectsome"

cmd.Parameters.Add("@id", SqlDbType.Int).Value = Val(TextBox1.Text)

tb2.Load(cmd.ExecuteReader)

DataGridView1.DataSource = tb2

End If

بيطلع لى error Procedure selectall has no parameters and arguments were supplied

مش عارفا ليه ؟؟؟؟؟؟

دا الprocedure

ALTER PROCEDURE [dbo].[selectall]

-- Add the parameters for the stored procedure here

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

-- Insert statements for procedure here

select id as oldid,id as id ,name as name ,super as super from dept

END

الخطا بيظهر فى textbox="" بحيث انى عايزاه لما يكون فاضى يظهر لى جميع الادارات

وشكرا

#2

الإجراء المخزن ليس فيه بارامترات و لكنك في الكود أضفت إليه بارامتر.

مواضيع مشابهة