hi how to get two texbox related values from sql table to crystal report in winform
using c# language
am having two text box and one button
please suggest me..
thank u
How to get two textbox related values from sql table to crystal report in winform using c#?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 11, 2012, 2:28 AM EDT
Try this...
using System.Data.OleDb;
string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["dsn"];
OleDbCommand com;
string str;
private void button1_Click(object sender, EventArgs e)
{
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "select * from employee where name='" + textBox1.Text.Trim() + "'";
com = new OleDbCommand(str, con);
OleDbDataReader reader = com.ExecuteReader();
if (reader.Read())
{
textBox2.Text = reader["address"].ToString();
}
con.Close();
reader.Close();
}
Thanks
fahad sheikhji50 reputationPosted Jul 11, 2012, 2:39 AM EDT
this idea i know but how to get searched records details between two dates in crystal report
thanks