Click here to Skip to main content
15,389,833 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: a prefix of _ctl0_ to an asp.net link button Pin
Member 1058475710-Feb-14 4:46
MemberMember 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
MemberMember 1058475710-Feb-14 10:26 
QuestionHow to develop Time Scheduler in asp.net web application? Pin
vivek nuna10-Feb-14 0:21
Membervivek nuna10-Feb-14 0:21 
GeneralHow can Create this table in sql Pin
pabitra behera8-Feb-14 20:39
Memberpabitra 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
MemberPriyanka 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
MemberWombaticus9-Feb-14 3:10 
QuestionHow to tie a gridview row edit properly Pin
Member 105796217-Feb-14 6:55
MemberMember 105796217-Feb-14 6:55 
AnswerRe: How to tie a gridview row edit properly Pin
Ali Al Omairi(Abu AlHassan)9-Feb-14 11:43
professionalAli Al Omairi(Abu AlHassan)9-Feb-14 11:43 
Questionhow to bind image from database to image control in asp.net Pin
Member 104959267-Feb-14 1:03
MemberMember 104959267-Feb-14 1:03 
AnswerRe: how to bind image from database to image control in asp.net Pin
Richard Deeming7-Feb-14 1:58
mveRichard Deeming7-Feb-14 1:58 
Questionhow to convert image into text Pin
luckyhids7-Feb-14 0:21
Memberluckyhids7-Feb-14 0:21 
AnswerRe: how to convert image into text Pin
Philip Cotan7-Feb-14 11:25
MemberPhilip Cotan7-Feb-14 11:25 
GeneralRe: how to convert image into text Pin
luckyhids17-Oct-18 2:50
Memberluckyhids17-Oct-18 2:50 
QuestionAsp.net Pin
Member 105786837-Feb-14 0:15
MemberMember 105786837-Feb-14 0:15 
AnswerRe: Asp.net Pin
Ahmed Bensaid12-Feb-14 22:41
professionalAhmed Bensaid12-Feb-14 22:41 
QuestionBuilt in authentication Pin
larsp7776-Feb-14 1:41
Memberlarsp7776-Feb-14 1:41 
AnswerRe: Built in authentication Pin
Richard Deeming6-Feb-14 1:57
mveRichard Deeming6-Feb-14 1:57 
GeneralRe: Built in authentication Pin
larsp7776-Feb-14 2:00
Memberlarsp7776-Feb-14 2:00 
GeneralRe: Built in authentication Pin
Ali Al Omairi(Abu AlHassan)6-Feb-14 2:32
professionalAli Al Omairi(Abu AlHassan)6-Feb-14 2:32 
GeneralRe: Built in authentication Pin
Richard Deeming6-Feb-14 2:38
mveRichard Deeming6-Feb-14 2:38 
GeneralRe: Built in authentication Pin
joginder-banger6-Feb-14 4:27
professionaljoginder-banger6-Feb-14 4:27 
QuestionASP.NET MVC Web API - filter query with pagesize Pin
miss7865-Feb-14 22:39
Membermiss7865-Feb-14 22:39 

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.