Hey Guys.

I am quite new in C# and MYSQL, but u can definetly help me out!
I am supposed to insert a new row to MYSQL server, i am unable to do so after too much of browsing kindly help me...

the code till now is as...

string connStr = "server=localhost;user=root;database=parking;port=3306;password=root;";

MySqlConnection conn = new MySqlConnection(connStr);
conn.Open();

string sql = "INSERT INTO venue1(space_id,vehicle_no,dl_no,available) VALUES (spc,txtvehno.Text,txtdlno.Text,0)";

MySqlCommand cmd = new MySqlCommand(sql, conn);

space_id,vehicle_no,dl_no,available are the respective fields in the DB, and i have to add data to it from the textboxes on the form.

what is code further to make entry in to the DB,, its smthing related to parameters, nd i am unable to get tht..
kindly help me out...

You have to write the textBox1.text from which you are entering data into the db as '"+textBox1.text+"'
only then it will work.
hope I helped.:)

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.