This is A C# Practice code:
Video For Result:
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace dataentry
- {
- public partial class datatotextbox : Form
- {
- SqlConnection abcdata = new SqlConnection("Data Source=.;Initial Catalog=DATAENTRY;Integrated Security=True;Pooling=False");
- public datatotextbox()
- {
- InitializeComponent();
- }
- private void button9_Click(object sender, EventArgs e)
- {
- SqlDataAdapter asdf = new SqlDataAdapter("select * from REGISTER where id ='" + textBox1.Text + "' ", abcdata);
- DataTable ss = new DataTable();
- asdf.Fill(ss);
- textBox1.Text = ss.Rows[0][0].ToString();
- textBox2.Text = ss.Rows[0][1].ToString();
- comboBox1.Text = ss.Rows[0][2].ToString();
- comboBox2.Text = ss.Rows[0][6].ToString();
- textBox3.Text = ss.Rows[0][3].ToString();
- textBox4.Text = ss.Rows[0][4].ToString();
- textBox5.Text = ss.Rows[0][5].ToString();
- }
- }
- }
Facebook Comment