Click here to Skip to main content
15,910,471 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: how to add data in listbox sql server using store procedure Pin
thatraja10-Feb-14 22:25
professionalthatraja10-Feb-14 22:25 
QuestionHow to call a Phython Script from .Net Pin
Kandepu Rajesh10-Feb-14 21:03
Kandepu Rajesh10-Feb-14 21:03 
AnswerRe: How to call a Phython Script from .Net Pin
Kornfeld Eliyahu Peter10-Feb-14 23:24
professionalKornfeld Eliyahu Peter10-Feb-14 23:24 
Questionon hover on menu items Pin
Shashi Ranjan10-Feb-14 19:42
Shashi Ranjan10-Feb-14 19:42 
QuestionUpload file to SQL database using html5 Pin
Member 1057920210-Feb-14 7:49
Member 1057920210-Feb-14 7:49 
AnswerRe: Upload file to SQL database using html5 Pin
Richard Deeming10-Feb-14 8:11
mveRichard Deeming10-Feb-14 8:11 
GeneralRe: Upload file to SQL database using html5 Pin
Member 1057920210-Feb-14 11:39
Member 1057920210-Feb-14 11:39 
GeneralRe: Upload file to SQL database using html5 Pin
Richard Deeming11-Feb-14 1:03
mveRichard Deeming11-Feb-14 1:03 
GeneralRe: Upload file to SQL database using html5 Pin
Member 1057920212-Feb-14 11:57
Member 1057920212-Feb-14 11:57 
Questionweb api - global.aspx error - does not contain a constructor that takes 0 arguments Pin
miss78610-Feb-14 3:22
miss78610-Feb-14 3:22 
AnswerRe: web api - global.aspx error - does not contain a constructor that takes 0 arguments Pin
Richard Deeming10-Feb-14 4:42
mveRichard Deeming10-Feb-14 4:42 
GeneralRe: web api - global.aspx error - does not contain a constructor that takes 0 arguments Pin
miss78611-Feb-14 5:57
miss78611-Feb-14 5:57 
Questiona prefix of _ctl0_ to an asp.net link button Pin
Member 1058475710-Feb-14 0:25
Member 1058475710-Feb-14 0:25 
AnswerRe: a prefix of _ctl0_ to an asp.net link button Pin
Deflinek10-Feb-14 2:24
Deflinek10-Feb-14 2:24 
AnswerRe: a prefix of _ctl0_ to an asp.net link button Pin
Richard Deeming10-Feb-14 3:07
mveRichard Deeming10-Feb-14 3:07 
GeneralRe: a prefix of _ctl0_ to an asp.net link button Pin
Member 1058475710-Feb-14 4:46
Member 1058475710-Feb-14 4:46 
GeneralRe: a prefix of _ctl0_ to an asp.net link button Pin
Richard Deeming10-Feb-14 4:52
mveRichard Deeming10-Feb-14 4:52 
GeneralRe: a prefix of _ctl0_ to an asp.net link button Pin
Member 1058475710-Feb-14 10:26
Member 1058475710-Feb-14 10:26 
QuestionHow to develop Time Scheduler in asp.net web application? Pin
vivek nuna10-Feb-14 0:21
vivek nuna10-Feb-14 0:21 
GeneralHow can Create this table in sql Pin
pabitra behera8-Feb-14 20:39
pabitra behera8-Feb-14 20:39 
AnswerRe: How can Create this table in sql Pin
Kornfeld Eliyahu Peter8-Feb-14 21:55
professionalKornfeld Eliyahu Peter8-Feb-14 21:55 
GeneralRe: How can Create this table in sql Pin
thatraja9-Feb-14 20:28
professionalthatraja9-Feb-14 20:28 
Questioninserting data in mysql database using c# Pin
Priyanka Sundaraj8-Feb-14 1:08
Priyanka Sundaraj8-Feb-14 1:08 
Hi I wanted to insert my form into mysql database
Below is the code i used

protected void Submit_Click(object sender, EventArgs e)
{
MySqlConnection connection = null;
if(RadioButton1.Checked==true)
{
lblgender.Text= RadioButton1.Text;
}
else
{
lblgender.Text= RadioButton2.Text;
}
lblbusinessCat.Text=DropDownList1.SelectedValue;
using (connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString))
{
try
{
string sql = "INSERT INTO login(Username, Gender, Email, MobileNo, Category_Id, CompanyArea, CompanyName, CompanyNo, AltCompanyNo, Address)VALUES ('@Username', '@Gender', '@Email', '@MobileNo', '@Category_Id', '@CompanyArea', '@CompanyName', '@CompanyNo', '@AltCompanyNo', '@Address') ";

MySqlCommand cmd = new MySqlCommand(sql);

cmd.Parameters.AddWithValue("@Username", txtUserName.Text.Trim());
cmd.Parameters.AddWithValue("@Gender", lblgender.Text.Trim());
cmd.Parameters.AddWithValue("@Email", txtEmailId.Text.Trim());
cmd.Parameters.AddWithValue("@MobileNo", txtmobile.Text.Trim());
cmd.Parameters.AddWithValue("@Category_Id", lblbusinessCat.Text.Trim());
cmd.Parameters.AddWithValue("@CompanyArea", txtCompanyLoc.Text.Trim());
cmd.Parameters.AddWithValue("@CompanyName", txtCompanyname.Text.Trim());
cmd.Parameters.AddWithValue("@CompanyNo", txtCompNo.Text.Trim());
cmd.Parameters.AddWithValue("@AltCompanyNo", txtCompaltNo.Text.Trim());
cmd.Parameters.AddWithValue("@Address", txtCompAddress.Text.Trim());

cmd.Connection = connection;
connection.Open();
cmd.ExecuteNonQuery();



Session["username"] = txtUserName.Text;
Response.Redirect("Business_NewUpload.aspx", false);
//lblError.Text = "Data Saved";
}
catch (Exception ex)
{
Response.Write("An error occured: " + ex.Message);
//lblError.Text = ex.Message;
Response.Redirect("BusinessMoney_About.aspx", false);
}
finally
{
if (connection != null)
{
connection.Close(); //close the connection
}
}
}

}


i dont get any error , but my values are getting stored as @username,@gender

Please anyone help me.....It is very urgent for me to correct this
AnswerRe: inserting data in mysql database using c# Pin
Wombaticus9-Feb-14 3:10
Wombaticus9-Feb-14 3:10 
QuestionHow to tie a gridview row edit properly Pin
Member 105796217-Feb-14 6:55
Member 105796217-Feb-14 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.