Click here to Skip to main content
15,920,031 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
reply me database connection using dataset for inserting into table.
step by step procedure i want.
Posted
Comments
Christian Graus 21-Jun-11 5:33am    
Every day at the same time, this site is flooded with questions easily answered by google or a book. Is there a country that doesn't have google, or books, that comes online at this time ?

You could:
1) Try being a little politer.
2) Try google first: http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=database+connection+using+dataset+for+inserting+into+table[^] The top link looks kinda relevant...
 
Share this answer
 
Hi,
Hope you are new to this site, Before posting questions better google it your self. Any ways here is the link you may follow.

http://en.kioskea.net/forum/affich-61898-how-to-make-database-connectivity-in-asp-net[^]


Regards

Shiv
 
Share this answer
 
Please look at this page again:
http://www.codeproject.com/Questions/ask.aspx[^]

Look at the bottom of the page: "A few simple rules when posting your question". Please be so kind to read and utilize them.

—SA
 
Share this answer
 
Creating the Database
Now let's create the database, and the table that we are going to query from our application later on.
From the command line, we start by creating the database:
Collapse
create database ConnectCsharpToMysql;
Then we select the database to use before creating the table:
Collapse
use ConnectCsharpToMysql;
And we create the table that we will query from our application:

using MySql.Data.MySqlClient;
//add MySQL library

private void button1_Click_1(object sender, EventArgs e)
{
string mycon = "SERVER=localhost;DATABASE=manager;UID=root;password=123456";
MySqlConnection connection = new MySqlConnection(mycon);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from logging where Name='" + textBox1.Text + "' AND Password='" + textBox2.Text + "'";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
if (this.textBox1.Text.Equals(Reader.GetString(0)) && this.textBox2.Text.Equals(Reader.GetString(1)))
{
skl mykk = new skl();
mykk.Show();

}
}


}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900