private void EnterAcNotextBox_TextChanged(object sender, EventArgs e)
{
int id;
if (!int.TryParse(AcNotextBox.Text, out id))
{
return;
}
string connString = ConfigurationManager.ConnectionStrings["dbx"].ConnectionString;
string cmdString = "SELECT '#' FROM tblBasicInfo, tblAccData WHERE ID =" + Convert.ToInt32(AcNotextBox.Text);
//string query = "SELECT * FROM tblAccData WHERE ID =" + Convert.ToInt32(AcNotextBox.Text);
using (OleDbConnection conn = new OleDbConnection(connString))
{
using (OleDbCommand cmd = new OleDbCommand(cmdString, conn))
{
conn.Open();
OleDbDataReader reader = cmd.ExecuteReader();
if (reader.Read())
{
StudentNametextBox.Text = (reader["SName"].ToString());
FatherNametextBox.Text = (reader["FName"].ToString());
ClasscomboBox.Text = (reader["ClassofReading"].ToString());
TransportFatextBox.Text = (reader["TranFacility"].ToString());
RemarkstextBox.Text = (reader["Remarks"].ToString());
CelltextBox.Text = (reader["Cell"].ToString());
TrantextBox.Text = (reader["TransportChr"].ToString());
DuestextBox.Text = (reader["Dues"].ToString());
AdmfeetextBox.Text = (reader["Adm"].ToString());
ProFeetextBox.Text = (reader["Pro"].ToString());
}
}
}
fazle_1
0
Newbie Poster
Recommended Answers
Jump to PostIs this a tutorial or was the question forgotten?
Read https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question then update your discussion.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.