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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
fahad sheikhjiPosted Jul 11, 2012, 6:39 AM
this idea i know but how to get searched records details between two dates in crystal report
thanks
Satyapriya NayakPosted Jul 11, 2012, 6:28 AM
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