Click here to Skip to main content
15,887,214 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: the two web services provided in the article of Sending messages in asp.net through we service ???? Pin
Christian Graus31-Aug-09 21:05
protectorChristian Graus31-Aug-09 21:05 
JokeRe: the two web services provided in the article of Sending messages in asp.net through we service ???? Pin
Arun Jacob31-Aug-09 21:24
Arun Jacob31-Aug-09 21:24 
Questiononscroll event not fire in IE 6 with select box i need to call Javascript on onscroll event Pin
anish27patel31-Aug-09 20:48
anish27patel31-Aug-09 20:48 
QuestionHow to retrieving the binary data from the database? Pin
abglorie31-Aug-09 20:25
abglorie31-Aug-09 20:25 
AnswerRe: How to retrieving the binary data from the database? Pin
Christian Graus31-Aug-09 20:30
protectorChristian Graus31-Aug-09 20:30 
Questionupdate database Pin
mylogics31-Aug-09 20:20
professionalmylogics31-Aug-09 20:20 
AnswerRe: update database Pin
Christian Graus31-Aug-09 20:34
protectorChristian Graus31-Aug-09 20:34 
GeneralRe: update database Pin
mylogics31-Aug-09 20:47
professionalmylogics31-Aug-09 20:47 
Actually i want to insert data in Product.db table
it has columns named:
PID: which is auto number
ProductID:Which is Primary key
and others columnss are:ProductName,ProductDescription,ProductPrice,VendorID;
i want the entries in ProductID table like when PID value is 1
ProductID value becomes PID1.in have written code for this on button click.but the Promblem occurs that when somebody deletes the rows of
the table the new PID Value doesnt start from 1.it start from last deleted value of PID.Now i want that ProductID value gets update according to the PID value.the code at button click is:
string str1 = "Select MAX(PID) From Product";
       OleDbCommand cmd = new OleDbCommand(str1, conn);
       conn.Open();
       string max= cmd.ExecuteScalar().ToString();
       if (max == "")
       {
           max = "PID" + 1;
       }
       else
       {
       int i= Convert.ToInt32(max) + 1;
       string s1=Convert.ToString(i);
       max = "PID" + s1;
       }
       conn.Close();
       string str = "Insert Into Product(ProductID,ProductName,ProductDescription,ProductPrice)Values('"+max+"','" + txtprdtname.Text + "','" + txtprdtdescrp.Text + "','" + txtprdtprice.Text + "')";
       cmd = new OleDbCommand(str, conn);
       conn.Open();
       cmd.ExecuteNonQuery();
       conn.Close();
       str = "Select * From Product";
       cmd = new OleDbCommand(str, conn);
       OleDbDataReader dr1 = null;
       conn.Open();
       dr1 = cmd.ExecuteReader();
       DropDownList2.DataSource = dr1;
       DropDownList2.DataTextField = "ProductID";
       DropDownList2.DataValueField = "ProductID";
       DropDownList2.DataBind();
       conn.Close();


so m trying to update the ProductID value AS i have default inserted
PID1 when the first row is inserted in Product table.
GeneralRe: update database Pin
Coding C#31-Aug-09 20:57
Coding C#31-Aug-09 20:57 
GeneralRe: update database Pin
mylogics31-Aug-09 21:03
professionalmylogics31-Aug-09 21:03 
GeneralRe: update database Pin
Christian Graus31-Aug-09 21:07
protectorChristian Graus31-Aug-09 21:07 
GeneralRe: update database Pin
Christian Graus31-Aug-09 21:03
protectorChristian Graus31-Aug-09 21:03 
JokeRe: update database Pin
Greg Chelstowski31-Aug-09 21:33
Greg Chelstowski31-Aug-09 21:33 
GeneralRe: update database Pin
Christian Graus1-Sep-09 12:16
protectorChristian Graus1-Sep-09 12:16 
QuestionOnClientClick Event Pin
KhandelwalA31-Aug-09 20:19
KhandelwalA31-Aug-09 20:19 
AnswerRe: OnClientClick Event Pin
Christian Graus31-Aug-09 20:35
protectorChristian Graus31-Aug-09 20:35 
AnswerRe: OnClientClick Event Pin
Vimalsoft(Pty) Ltd31-Aug-09 21:24
professionalVimalsoft(Pty) Ltd31-Aug-09 21:24 
QuestionDeployment of project in asp.net Pin
ritasaumya31-Aug-09 20:05
ritasaumya31-Aug-09 20:05 
AnswerRe: Deployment of project in asp.net Pin
sashidhar31-Aug-09 20:11
sashidhar31-Aug-09 20:11 
AnswerRe: Deployment of project in asp.net Pin
Christian Graus31-Aug-09 20:15
protectorChristian Graus31-Aug-09 20:15 
AnswerRe: Deployment of project in asp.net Pin
Vimalsoft(Pty) Ltd31-Aug-09 21:27
professionalVimalsoft(Pty) Ltd31-Aug-09 21:27 
AnswerRe: Deployment of project in asp.net Pin
ncsubbu31-Aug-09 22:30
professionalncsubbu31-Aug-09 22:30 
QuestionPlease explain Pin
ME_Learner31-Aug-09 19:51
ME_Learner31-Aug-09 19:51 
AnswerRe: Please explain Pin
Blikkies31-Aug-09 20:02
professionalBlikkies31-Aug-09 20:02 
GeneralRe: Please explain Pin
Christian Graus31-Aug-09 20:17
protectorChristian Graus31-Aug-09 20:17 

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.