public partial class ministatement : Form { SqlConnection connect = new SqlConnection(@"data source=ABHINAV-PC\ABHI;integrated security=true;initial catalog=ATM;"); public ministatement() { InitializeComponent(); } private void ministatement_Load(object sender, EventArgs e) { connect.Open(); SqlCommand cmd = new SqlCommand("select * from transactions where account_no='" + label4.Text +"'" , connect); DataTable dth = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dth); dataGridView1.DataSource = dth; } } }
Decimal account_no= 0; if (label4.Text == "") { account_no= 0; } else { account_no = Convert.ToDecimal(label4.Text); }
string inputString = label4.Text int numValue; bool parsed = Int32.TryParse(inputString, out numValue); if (parsed) ... Then ur conditions
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)