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

Error 131

بدأه MasterDotNet في 17 يوليو 2009 · 3 رد · 278 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

ما الخطأ فى هذا الكود

الخطأ يظهر عند السطر باللون الحمر فى هذا الكود

SqlCommand area = new SqlCommand("select Area_Name From Area_workers Where Area_Id = @id", cnn);

area.Parameters.Add(new SqlParameter("@id", rd["Area_Id"].ToString()));

cnn.Open();

SqlDataReader rd = new sq

Button1.Text = aa + b;

TextBox1.Text = rd["Common_Name"].ToString();

TextBox2.Text = rd["Account_Number"].ToString();

TextBox4.Text = rd["Registration_No"].ToString();

TextBox5.Text = rd["Installed_Capacity"].ToString();

TextBox6.Text = rd["Pregnancy_Of_The_Contractual_joint"].ToString();

TextBox7.Text = rd["Monthly_Consumption"].ToString();

TextBox8.Text = rd["Annual_Consumption"].ToString();

TextBox12.Text = rd["Address"].ToString();

TextBox14.Text = rd["Name_Of_The_Person_Responsible"].ToString();

TextBox15.Text = rd["Mobile_No"].ToString();

TextBox16.Text = rd["Phone_No"].ToString();

TextBox33.Text = rd["Fax_No"].ToString();

TextBox17.Text = rd["Website"].ToString();

TextBox18.Text = rd["Email"].ToString();

TextBox19.Text = rd["Notes"].ToString();

TextBox35.Text = rd["Date_Of_Visit"].ToString();

TextBox20.Text = rd["Date_insert"].ToString();

}

rd.Close();

cnn.Close();

}

#2

لو فى حد عنده حل للمشكلة دى يا ريت يتفضل ويحلها او يرشدنى على الحل فين

شكراً

#3

طيب نوع المتحولات aa , b ماذكرته

لازم توضح أكثر

رَبِّ أَوْزِعْنِي أَنْ أَشْكُرَ نِعْمَتَكَ الَّتِي أَنْعَمْتَ عَلَيَّ وَعَلَى وَالِدَيَّ وَأَنْ أَعْمَلَ صَالِحًا تَرْضَاهُ وَأَدْخِلْنِي بِرَحْمَتِكَ فِي عِبَادِكَ الصَّالِحِينَ

تلاوات خاشعة مؤثرة

#4

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

هذا كل الكود اللى عندى

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data.SqlClient;

using System.Configuration;

public partial class Controls_editdelete : System.Web.UI.UserControl

{

protected void Page_Load(object sender, EventArgs e)

{

string a = "5";

SqlConnection cnn = new SqlConnection();

cnn.ConnectionString = ConfigurationManager.ConnectionStrings["cnn"].ConnectionString;

string cmdtext = "select count(*) from participants where Common_Id = @id";

SqlCommand cmd = new SqlCommand(cmdtext, cnn);

cmd.Parameters.Add(new SqlParameter("@id", a));

cnn.Open();

int res = (int)cmd.ExecuteScalar();

cnn.Close();

if (res == 0)

{

Response.Redirect("Controls.aspx?tab=common");

}

else

{

string gettext = "select * from participants where Common_Id = @id";

SqlCommand get = new SqlCommand(gettext, cnn);

get.Parameters.Add(new SqlParameter("@id", a));

cnn.Open();

SqlDataReader rd = get.ExecuteReader();

while (rd.Read())

{

string aa = rd["Common_Tariff_Cutting"].ToString();

string b = rd["Common_Tariff_Changing"].ToString();

if (b == "True")

{

RadioButton4.Checked = false;

RadioButton3.Checked = true;

}

if (aa == "True" )

{

RadioButton2.Checked = false;

RadioButton1.Checked = true;

}

SqlCommand area = new SqlCommand("select Area_Name From Area_workers Where Area_Id = @id", cnn);

area.Parameters.Add(new SqlParameter("@id", rd["Area_Id"].ToString()));

cnn.Open();

SqlDataReader rd = new sq

Button1.Text = aa + b;

TextBox1.Text = rd["Common_Name"].ToString();

TextBox2.Text = rd["Account_Number"].ToString();

TextBox4.Text = rd["Registration_No"].ToString();

TextBox5.Text = rd["Installed_Capacity"].ToString();

TextBox6.Text = rd["Pregnancy_Of_The_Contractual_joint"].ToString();

TextBox7.Text = rd["Monthly_Consumption"].ToString();

TextBox8.Text = rd["Annual_Consumption"].ToString();

TextBox12.Text = rd["Address"].ToString();

TextBox14.Text = rd["Name_Of_The_Person_Responsible"].ToString();

TextBox15.Text = rd["Mobile_No"].ToString();

TextBox16.Text = rd["Phone_No"].ToString();

TextBox33.Text = rd["Fax_No"].ToString();

TextBox17.Text = rd["Website"].ToString();

TextBox18.Text = rd["Email"].ToString();

TextBox19.Text = rd["Notes"].ToString();

TextBox35.Text = rd["Date_Of_Visit"].ToString();

TextBox20.Text = rd["Date_insert"].ToString();

}

rd.Close();

cnn.Close();

}

}

protected void Button2_Click(object sender, EventArgs e)

{

}

protected void Button1_Click(object sender, EventArgs e)

{

}

}

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