Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to refresh the data table in C# window form datagridview

con.Open();
MySqlDataAdapter MyDA = new MySqlDataAdapter();
string sqlSelectAll = "SELECT * from dailyprice";
MyDA.SelectCommand = new MySqlCommand(sqlSelectAll, con);

DataTable table = new DataTable();
MyDA.Fill(table);

BindingSource bSource = new BindingSource();
bSource.DataSource = table;


dataGridView1.DataSource = bSource;
con.Close();
Comment

how to refresh the data table in C# window form datagridview

cmd = new OleDbCommand("insert into FWINFOS (ID,Name,Gender,DateOfBirth,Race,WorkingPlace,PassportNO,DateOfExpire,[Position],Photo) values('" + textBox5.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + dateTimePicker1.Value + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox6.Text + "','" + dateTimePicker2.Value + "',@Position,@Photo)", con);


        cmd.Parameters.AddWithValue("@Position", comboBox1.SelectedText.ToString());
        conv_photo();

        con.Open();
        int n = cmd.ExecuteNonQuery();
        //cmd.ExecuteNonQuery();
        con.Close();
        if (n > 0)
        {
            MessageBox.Show("Inserted");
            loaddata();

            rno++;
        }
        else
            MessageBox.Show("No Insert");



    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: Camera follow player script unity 
Csharp :: c# pull request 
Csharp :: c# enum key value 
Csharp :: Working with null values 
Csharp :: c# param exception 
Csharp :: photon 
Csharp :: c# Unit Test IDbContextFactory 
Csharp :: pause and resume thread C# 
Csharp :: Toggle value change 
Csharp :: Include multiple siblings at the Level 
Csharp :: Razor break/continue in loop 
Csharp :: hierachical table to c# class 
Csharp :: c# entity framework order by array 
Csharp :: add auto mapper in startup 
Csharp :: how to know if object with a certain tag exists unity c# 
Csharp :: c# propertyinfo indexof 
Csharp :: how to make build events always run visual studio 
Csharp :: how to delete dotnet project 
Csharp :: flutter find a widget 
Csharp :: how to make a console feedback 
Csharp :: select startup item visual studio 2019 
Csharp :: händelsereportage 
Csharp :: world space constant size 
Csharp :: get the next letter after specific character in c# 
Csharp :: block wapalyzer from detecting codeigniter 
Csharp :: how do make internet 
Csharp :: how to print a word in C# 
Csharp :: calculated field gridview asp.net 
Csharp :: php check syntax error folder 
Csharp :: how to twist a image in the code behind C# 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =