السلام عليكم هذه اول مشكاركة لي بالمنتدى وياريت اتحصل على مساعدة
أنا أفوم بعمل موقع صغير والسؤال هو اني عندي جدول في قواعد البيانات Products كما هو موضح بالاسفل
[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
وعندي فورم يحتوي على مجموع TextBox لكل الحقول الموضحة في الاعلى قمت بعمل كلاس بحيث اني ادخل رقم البرودكت واضغط على انتر فان جميع البيانات يمت عرضها في التكست بوكس الخاص بكل حقل من الداتا بيس
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));ولكن للاسف لم يشتغل فرجاء لو سمحتو من لديه فكرة في تحسين الموضوع والكود ان يتكرم ولكم جزيل الشكر

