نیما حتمی
یک شنبه 21 فروردین 1390, 13:45 عصر
با سلام
بنده بر حسب نیاز ،نیاز دارم که از جدول موجود در بانکم سه نوع داده بکشم بیرون که ارور زیر رو می ده
68535و اینم کدش:
[
SqlDataAdapter selectfromsetcoding = new SqlDataAdapter("select AccTitle as N1 from AccCoding where acccode < '" + s + "' and AccLevel='کل' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding2 = new SqlDataAdapter("select AccTitle as N2 from AccCoding where acccode < '" + s + "' and AccLevel='معین' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding3 = new SqlDataAdapter("select AccTitle as N3 from AccCoding where acccode = '" + s + "' and AccLevel='تفضیلی' ORDER BY Acccode DESC", connect);
DataTable y = new DataTable();
DataTable y1 = new DataTable();
DataTable y2 = new DataTable();
selectfromsetcoding.Fill(y);
selectfromsetcoding2.Fill(y1);
selectfromsetcoding3.Fill(y2);
if (y.Rows.Count > 0)
{
AllSetting.KolAccount = y.Rows[0]["N1"].ToString();
AllSetting.Save();
}
if (y1.Rows.Count > 0)
{
AllSetting.MoeinAccount = y.Rows[0]["N2"].ToString();
AllSetting.Save();
}
if (y2.Rows.Count > 0)
{
AllSetting.TafziliAccount = y.Rows[0]["N3"].ToString();
AllSetting.Save();
}
بنده بر حسب نیاز ،نیاز دارم که از جدول موجود در بانکم سه نوع داده بکشم بیرون که ارور زیر رو می ده
68535و اینم کدش:
[
SqlDataAdapter selectfromsetcoding = new SqlDataAdapter("select AccTitle as N1 from AccCoding where acccode < '" + s + "' and AccLevel='کل' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding2 = new SqlDataAdapter("select AccTitle as N2 from AccCoding where acccode < '" + s + "' and AccLevel='معین' ORDER BY Acccode DESC", connect);
SqlDataAdapter selectfromsetcoding3 = new SqlDataAdapter("select AccTitle as N3 from AccCoding where acccode = '" + s + "' and AccLevel='تفضیلی' ORDER BY Acccode DESC", connect);
DataTable y = new DataTable();
DataTable y1 = new DataTable();
DataTable y2 = new DataTable();
selectfromsetcoding.Fill(y);
selectfromsetcoding2.Fill(y1);
selectfromsetcoding3.Fill(y2);
if (y.Rows.Count > 0)
{
AllSetting.KolAccount = y.Rows[0]["N1"].ToString();
AllSetting.Save();
}
if (y1.Rows.Count > 0)
{
AllSetting.MoeinAccount = y.Rows[0]["N2"].ToString();
AllSetting.Save();
}
if (y2.Rows.Count > 0)
{
AllSetting.TafziliAccount = y.Rows[0]["N3"].ToString();
AllSetting.Save();
}