[Productid] [int] IDENTITY(1,1) NOT NULL, [Productname] [varchar](50) NULL, [Descs] [varchar](50) NULL, [Quantity] [int] NULL, [amountvalue] [float] NULL, [productpendingamount] [float] NULL, CONSTRAINT [PK_Products] PRIMARY KEY CLUSTERED
public void showdproductetails (int a, string b, string c, int d, float e, float f) { string strc = ConfigurationManager.ConnectionStrings["Products"].ConnectionString; SqlConnection con = new SqlConnection(strc); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "select Productname, Descs, Quantity, amountvalue, productpendingamount from Products where productid = @a"; cmd.Parameters.AddWithValue("a", a); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { b = rd.GetString(0); c = rd.GetString(1); d = rd.GetInt32(2); e = rd.GetFloat(3); f = rd.GetFloat(4); }
Products objfind = new Products(); objfind.showdproductetails(int.Parse(TextBox1.Text), TextBox2.Text, TextBox3.Text, int.Parse(TextBox4.Text), float.Parse(TextBox5.Text), float.Parse(TextBox6.Text));