while converting anything into string where to use GetInt32

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 2
Reputation: achtani_jeetu is an unknown quantity at this point 
Solved Threads: 0
achtani_jeetu achtani_jeetu is offline Offline
Newbie Poster

while converting anything into string where to use GetInt32

 
0
  #1
Dec 28th, 2008
the thing is I am just a beginner and started learning .net. Can anyone tell me about the meaning of this statement. Here myrdr is the object of sqldatareader. Your responses are highly appreciated. And I had some pressure so got to learn things quickly. Please Reply and Thanks in advance.
Regards
TextBox1.Text = System.Convert.ToString(myrdr.GetInt32(0) + 1);
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 2
Reputation: achtani_jeetu is an unknown quantity at this point 
Solved Threads: 0
achtani_jeetu achtani_jeetu is offline Offline
Newbie Poster

Re: while converting anything into string where to use GetInt32

 
0
  #2
Dec 28th, 2008
sorry i write the whole code.
  1. SqlConnection myconn = new SqlConnection(connstr);
  2. SqlCommand mycomm = new SqlCommand();
  3. mycomm.Connection = myconn;
  4. mycomm.CommandText = "select max(saleordno) from salesordmast";
  5. myconn.Open();
  6. SqlDataReader myrdr = mycomm.ExecuteReader();
  7. myrdr.Read();
  8. if (myrdr.IsDBNull(0) != true)
  9. {
  10.  
  11. TextBox1.Text = System.Convert.ToString(myrdr.GetInt32(0) + 1);
  12. }
  13. else
  14. TextBox1.Text = "1";
Last edited by peter_budo; Dec 29th, 2008 at 11:30 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 49
Reputation: iDeveloper is an unknown quantity at this point 
Solved Threads: 7
iDeveloper iDeveloper is offline Offline
Light Poster

Re: while converting anything into string where to use GetInt32

 
0
  #3
Dec 28th, 2008
It converts an integer value in column 0 to a 32 bit integer and adds 1 to it. Then it converts it to a string in order to assign it to a text box. If column 0 doesn't have a value it assigns a 1 to the textbox.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC