

C# Da Database Baglanti Hatasi, Build Yapildiginda Hata Yok , Ama Calisan Program Hata Veriyor
-
beyler peki listelemeyi nasil yapabilirim ? fikir verebilirmisiniz ?
yani combodan sectigim urun listelenmiyor sayfada ?
public static void comboprperties(ComboBox Producecombo, TextBox Name, TextBox Quantity, TextBox Madeby, TextBox Adddate, TextBox Priceperone, TextBox Priceforall, TextBox Produceinformation)
{
if (Producecombo.SelectedIndex == -1)
{
Producecombo.ResetText();
Name.ResetText();
Quantity.ResetText();
Madeby.ResetText();
Adddate.ResetText();
Priceperone.ResetText();
Priceforall.ResetText();
Produceinformation.ResetText();
}
else
{
OleDbConnection cn = new OleDbConnection(classes.Urunconnetion.CON);
OleDbCommand com = new OleDbCommand("Select ProduceId, ProduceName, ProduceQuantity, ProduceMadeby, ProduceAdddate, ProducePriceperone, ProducePriceforall, ProduceInformation From Urun Where ProduceId=@ID", cn);
com.Parameters.AddWithValue("@ID", Producecombo.SelectedValue);
if (com.Connection.State == ConnectionState.Closed)
{
com.Connection.Open();
}
OleDbDataReader dr = com.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
Name.Text = dr["ProduceName"].ToString();
Quantity.Text = dr["ProduceQuantity"].ToString();
Madeby.Text = dr["ProduceMadeby"].ToString();
Adddate.Text = dr["ProduceAdddate"].ToString();
Priceperone.Text = dr["ProducePriceperone"].ToString();
Priceforall.Text = dr["ProducePriceforall"].ToString();
Produceinformation.Text = dr["ProduceInformation"].ToString();
}
}
dr.Close();
cn.Close();
}
}
#endregion -
UCANTENEKE bunu yazdı:
-----------------------------
cemnet bunu yazdı:
-----------------------------
data type hatası demiş işte .. Mesela sayı olarak tanımlanan bir stuna sen harf ekliyosundur falan filan işte ..
-----------------------------
-----------------------------bu linkde ki amaç ne ?
Adamın sorunu gördüğün gibi veri tipi hatasına çıkmıyomu ?