C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to update columes in the mysql using C#.net


Posted Date: 29 Aug 2008      Total Responses: 2

Posted By: krishnakumari       Member Level: Bronze     Points: 1


I tried with normal sql query.



Is it same as sql server 2005 or is their any diiff.

please help me.



very urgent




Responses

Author: Pradeep Kumar Chaudhary    29 Aug 2008Member Level: GoldRating:     Points: 4
Dear Friend,
In case of C#.NET you need to install Microsoft SQL Server. From that you can easily configure your database.For your requirement of the project you can built your database and their table. For download the sql server you go through the microsoft site and easily install them in your system.


Author: krishnakumari    29 Aug 2008Member Level: BronzeRating:     Points: 6
Hi friend,
I have done inserstion to the mysql database.
For that I used DLL(mysql.data.sqlclient).
No error, but the data is not updated in the table.

this is the code:


string un = (string)Session["username"];
string dob = ddldate.Text + "/" + ddlmonth.Text + "/" + ddlyear.Text;
MySqlCommand cmd = new MySqlCommand("update tbl_users set firstname=@firstname,sex=@sex,DOB=@dob,country=@country,State=@state,city=@city,Email=@email where username="+"'" + un+"'", conn);
cmd.Parameters.AddWithValue("@firstname", txtfirst.Text);
cmd.Parameters.AddWithValue("@sex", rblsex.Text);
cmd.Parameters.AddWithValue("@dob", dob);
cmd.Parameters.AddWithValue("@country", ddlcountry.Text);
cmd.Parameters.AddWithValue("@state", txtstate.Text);
cmd.Parameters.AddWithValue("@city", txtcity.Text);
cmd.Parameters.AddWithValue("@email", txtemail.Text);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();



Post Reply
You must Sign In to post a response.
Next : GridView
Previous : General
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

fax server

Contact Us    Privacy Policy    Terms Of Use