السلام عليكــم ورحمـة الله وبركاتــه ،،
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="" بحيث انى عايزاه لما يكون فاضى يظهر لى جميع الادارات
وشكرا


