Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionWeb Application Compatibility Issue? Pin
Razanust20-Jun-10 19:49
Razanust20-Jun-10 19:49 
AnswerRe: Web Application Compatibility Issue? Pin
PSK_20-Jun-10 20:02
PSK_20-Jun-10 20:02 
AnswerRe: Web Application Compatibility Issue? Pin
meilixueshan20-Jun-10 21:30
meilixueshan20-Jun-10 21:30 
AnswerRe: Web Application Compatibility Issue? Pin
Ankur\m/20-Jun-10 23:32
professionalAnkur\m/20-Jun-10 23:32 
QuestionRandom number Pin
idea_00720-Jun-10 19:12
idea_00720-Jun-10 19:12 
AnswerRe: Random number Pin
Abhijit Jana20-Jun-10 19:13
professionalAbhijit Jana20-Jun-10 19:13 
AnswerRe: Random number Pin
PSK_20-Jun-10 19:55
PSK_20-Jun-10 19:55 
Questionhow to handle users at the same time to get different primarkey value Pin
developerit19-Jun-10 23:15
developerit19-Jun-10 23:15 
hi iam using asp.net2.o with c#

in my application

when user logins iam storing information in ordders table


OrderNo int primary key (auto increment)

email varchar(50)


and redirects to the orders page.and in this page he will retreive the newly primary key generated and stores in session as orders.

but at the same time another user logins then he is also getting the same orderno . how to handle this situation..

can you correct my code which helps me

protected void Button1_Click(object sender, EventArgs e)
    {
       //add
        
        int x = 0;
       

        foreach (GridViewRow row in GridView1.Rows)
        {


             CheckBox c1 = (CheckBox)row.FindControl("chk");
            TextBox qt = (TextBox)row.FindControl("txtQuantity");
            TextBox tot1 = (TextBox)row.FindControl("txtTotal");

            Label categoryname = (Label)row.FindControl("Label1");
            Label ItemKey = (Label)row.FindControl("Label2");
            Label ItemKeyNameE = (Label)row.FindControl("Label3");
            Label CurrentQTY = (Label)row.FindControl("Label4");
            Label SalesPrice = (Label)row.FindControl("Label5");
            //=====================================================



            if (c1.Checked == true)
            {
               
                int chempty = 0;

                SqlCommand getpk = new SqlCommand("select IDENT_CURRENT('TblOrder')", con);
                getpk.CommandTimeout = 0;
                con.Open();
                x = Convert.ToInt32(getpk.ExecuteScalar());
                Session["order"] = x;
                con.Close();
                //add to temp
                SqlCommand cmdtemp = new SqlCommand("Addtemp", con);
                cmdtemp.CommandType = CommandType.StoredProcedure;
                con.Open();
                cmdtemp.Parameters.AddWithValue("@OrderNo", Convert.ToInt32(x));
                cmdtemp.Parameters.AddWithValue("@CategoryNameE", categoryname.Text);
                cmdtemp.Parameters.AddWithValue("@ItemKey", ItemKey.Text);

                cmdtemp.Parameters.AddWithValue("@ItemKeyNameE", ItemKeyNameE.Text);
                cmdtemp.Parameters.AddWithValue("@CurrentQTY", CurrentQTY.Text);
                cmdtemp.Parameters.AddWithValue("@SalesPrice", SalesPrice.Text);
                cmdtemp.Parameters.AddWithValue("@Quantity", qt.Text);
                cmdtemp.Parameters.AddWithValue("@total", tot1.Text);
                chempty = Convert.ToInt32(cmdtemp.ExecuteNonQuery());

                con.Close();



            }

            
           
            

        }
        foreach (GridViewRow ro in GridView1.Rows)
        { 

            CheckBox c2 = (CheckBox)ro.FindControl("chk");
            TextBox qt1 = (TextBox)ro.FindControl("txtQuantity");
            TextBox tot1 = (TextBox)ro.FindControl("txtTotal");


            if (c2.Checked)
            {
                                c2.Checked= false;
                qt1.Visible = false;

                tot1.Visible = false;
            
            }
        }
        //Response.Redirect("CheckOut.aspx");

    }

AnswerRe: how to handle users at the same time to get different primarkey value Pin
Not Active20-Jun-10 1:49
mentorNot Active20-Jun-10 1:49 
AnswerRe: how to handle users at the same time to get different primarkey value Pin
Tej Aj20-Jun-10 21:20
Tej Aj20-Jun-10 21:20 
GeneralRe: how to handle users at the same time to get different primarkey value Pin
developerit20-Jun-10 21:47
developerit20-Jun-10 21:47 
QuestionAdding control and serverside script to page dynamically Pin
Fayu19-Jun-10 17:26
Fayu19-Jun-10 17:26 
AnswerRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 1:43
mentorNot Active20-Jun-10 1:43 
GeneralRe: Adding control and serverside script to page dynamically [modified] Pin
Fayu20-Jun-10 4:41
Fayu20-Jun-10 4:41 
GeneralRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 4:44
mentorNot Active20-Jun-10 4:44 
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 5:12
Fayu20-Jun-10 5:12 
GeneralRe: Adding control and serverside script to page dynamically Pin
Not Active20-Jun-10 9:21
mentorNot Active20-Jun-10 9:21 
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 12:27
Fayu20-Jun-10 12:27 
AnswerRe: Adding control and serverside script to page dynamically Pin
NeverHeardOfMe20-Jun-10 4:01
NeverHeardOfMe20-Jun-10 4:01 
GeneralRe: Adding control and serverside script to page dynamically Pin
Fayu20-Jun-10 4:39
Fayu20-Jun-10 4:39 
QuestionLock down a web site's allowable IP range to just one IP address [modified] Pin
jpang00119-Jun-10 15:43
jpang00119-Jun-10 15:43 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld19-Jun-10 23:46
professionalDaveAuld19-Jun-10 23:46 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
jpang00120-Jun-10 3:35
jpang00120-Jun-10 3:35 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
Dimitri Witkowski20-Jun-10 3:57
Dimitri Witkowski20-Jun-10 3:57 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld20-Jun-10 4:20
professionalDaveAuld20-Jun-10 4:20 

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.