Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

problem in select statement

$
0
0
private void txtPriceGold_Enter(object sender, EventArgs e) { string connstr = @"Server=.\SQLEXPRESS ;Initial Catalog=RPSJDB;Integrated Security=True; Max Pool Size=100"; string strSql = "select txtPriceGold from PriceTable Where txtPriceGold=" + txtPriceGold.Text+ ""; SqlConnection conn = new SqlConnection(connstr); conn.Open(); SqlCommand objCommand = new SqlCommand(strSql, conn); using (SqlDataReader dr = objCommand.ExecuteReader()) { bool success = dr.Read(); if (success) { txtPriceGold.Text = dr.GetString(1); } } conn.Close(); error is Incorrect syntax near '='.

Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>