Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace WET070073_I
- {
- public partial class User : Form
- {
- //DataGridViewCheckBoxColumn checkboxcol = new DataGridViewCheckBoxColumn();
- private BindingSource bsource = new BindingSource();
- //private SqlDataAdapter dAdapter = new SqlDataAdapter();
- //String sql;
- //DataSet dset=null;
- //private SqlConnection connStr;
- //private DataGridView dgView = new DataGridView();
- //private DataTable table = new DataTable();
- //private SqlConnection connStr = new SqlConnection("Data Source=AUTUMN-PC\\SQLEXPRESS;Initial Catalog=RetailPOS;User Id=sa;Password=m1nwoo;");
- public User()
- {
- InitializeComponent();
- }
- private void User_Load(object sender, EventArgs e)
- {
- // TODO: This line of code loads data into the 'retailPOSDataSet1.USERPROFILE' table. You can move, or remove it, as needed.
- this.uSERPROFILETableAdapter.Fill(this.retailPOSDataSet1.USERPROFILE);
- }
- private void buttonMainMenu_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void buttonUpdate_Click(object sender, EventArgs e)
- {
- SqlConnection conn = new SqlConnection("Data Source=AUTUMN-PC\\SQLEXPRESS;Initial Catalog=RetailPOS;User Id=sa;Password=m1nwoo;");
- string query = "select * from userprofile";
- SqlCommand cmd = new SqlCommand(query,conn);
- //Create a new data adapter based on the specified query.
- SqlDataAdapter dAdapter = new SqlDataAdapter(cmd);
- //Create a command builder to generate SQL update, insert, and
- //delete commands based on selectCommand. These are used to
- DataSet dset = new DataSet();
- dset.Table[0] = dset;
- dAdapter.Fill(dset,"USERPROFILE");
- dataGridView1.DataSource = bsource;
- dataGridView1.DataBindings = dset;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement