Click here to Skip to main content
15,908,661 members
Home / Discussions / C#
   

C#

 
QuestionWhat should be update query ??? Pin
Abhishek kumar1213-Oct-14 1:42
Abhishek kumar1213-Oct-14 1:42 
Hi,
I have added a dropdownlist for qualification.
The dropdownlist text and its value is diffrent. Which is as follow.
Like
Text Value
BA 3
Bcom 3
BCA 3
BSc 3
MA 5
MSc 5
MCOM 5

When I run update query it is not giving desired result.

if(!IsPostBack)
{
string UserName = Session["SUSERNAME"].ToString();
SqlConnection con = new SqlConnection("Data Source=AI-PC;Initial Catalog=db*******ony;uid=mahuri_admin;pwd=fr******68");
con.Open();
SqlCommand com = new SqlCommand("update tblRegistration set Qualification='" + Qualification_DropDownList.SelectedItem.Text + "' ,Qualification_Point='" + Qualification_DropDownList.SelectedValue.ToString() + "' where username='" + UserName + "' ", con);
com.ExecuteNonQuery();
con.Close();
lbl_Message.Visible = true;
}



What the Problem I am facing suppose I select BSC as qualification to update.
After clicking Update button when the page reloads the first text with the value 3 (BA) get selected and the BA is updated in database instead of BSC.
Please help me.
AnswerRe: What should be update query ??? Pin
Richard Deeming3-Oct-14 2:23
mveRichard Deeming3-Oct-14 2:23 
QuestionConverting Crystal Reports into Bitmap format Pin
itani1-Oct-14 20:03
itani1-Oct-14 20:03 
QuestionRe: Converting Crystal Reports into Bitmap format Pin
Richard MacCutchan1-Oct-14 21:43
mveRichard MacCutchan1-Oct-14 21:43 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Bernhard Hiller1-Oct-14 23:18
Bernhard Hiller1-Oct-14 23:18 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
Richard MacCutchan1-Oct-14 23:19
mveRichard MacCutchan1-Oct-14 23:19 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Marco Bertschi1-Oct-14 23:57
protectorMarco Bertschi1-Oct-14 23:57 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
Richard MacCutchan2-Oct-14 3:50
mveRichard MacCutchan2-Oct-14 3:50 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
jschell3-Oct-14 9:18
jschell3-Oct-14 9:18 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
Marco Bertschi4-Oct-14 2:17
protectorMarco Bertschi4-Oct-14 2:17 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
jschell6-Oct-14 10:01
jschell6-Oct-14 10:01 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Gerry Schmitz3-Oct-14 4:48
mveGerry Schmitz3-Oct-14 4:48 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Pete O'Hanlon1-Oct-14 23:50
mvePete O'Hanlon1-Oct-14 23:50 
GeneralRe: Converting Crystal Reports into Bitmap format Pin
Marco Bertschi1-Oct-14 23:54
protectorMarco Bertschi1-Oct-14 23:54 
AnswerRe: Converting Crystal Reports into Bitmap format Pin
Marco Bertschi1-Oct-14 23:52
protectorMarco Bertschi1-Oct-14 23:52 
QuestionUsing generics without the caller knowing what type to expect Pin
Jörgen Andersson1-Oct-14 9:00
professionalJörgen Andersson1-Oct-14 9:00 
AnswerRe: Using generics without the caller knowing what type to expect Pin
Eddy Vluggen1-Oct-14 9:07
professionalEddy Vluggen1-Oct-14 9:07 
GeneralRe: Using generics without the caller knowing what type to expect Pin
Jörgen Andersson1-Oct-14 21:14
professionalJörgen Andersson1-Oct-14 21:14 
GeneralRe: Using generics without the caller knowing what type to expect Pin
PIEBALDconsult1-Oct-14 9:41
mvePIEBALDconsult1-Oct-14 9:41 
GeneralRe: Using generics without the caller knowing what type to expect Pin
Jörgen Andersson1-Oct-14 21:30
professionalJörgen Andersson1-Oct-14 21:30 
AnswerRe: Using generics without the caller knowing what type to expect Pin
Pete O'Hanlon1-Oct-14 21:23
mvePete O'Hanlon1-Oct-14 21:23 
GeneralRe: Using generics without the caller knowing what type to expect Pin
Jörgen Andersson1-Oct-14 21:35
professionalJörgen Andersson1-Oct-14 21:35 
AnswerRe: Using generics without the caller knowing what type to expect Pin
jschell3-Oct-14 9:20
jschell3-Oct-14 9:20 
AnswerRe: Using generics without the caller knowing what type to expect Pin
aljodav3-Oct-14 18:22
aljodav3-Oct-14 18:22 
QuestionUsing protected set accessor Pin
robwm11-Oct-14 6:23
robwm11-Oct-14 6:23 

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.