Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem to load Data from form2 to form1.gridView Pin
CKnig10-Dec-07 1:10
CKnig10-Dec-07 1:10 
GeneralRe: problem to load Data from form2 to form1.gridView Pin
hdv21210-Dec-07 2:50
hdv21210-Dec-07 2:50 
GeneralRe: problem to load Data from form2 to form1.gridView Pin
CKnig10-Dec-07 2:56
CKnig10-Dec-07 2:56 
Generalchecking for a _ Pin
eyeseetee9-Dec-07 23:07
eyeseetee9-Dec-07 23:07 
GeneralRe: checking for a _ Pin
Bekjong9-Dec-07 23:24
Bekjong9-Dec-07 23:24 
GeneralRe: checking for a _ Pin
eyeseetee9-Dec-07 23:52
eyeseetee9-Dec-07 23:52 
GeneralDOM in C# Pin
Yoyosch9-Dec-07 22:45
Yoyosch9-Dec-07 22:45 
Generalchecking for a value Pin
eyeseetee9-Dec-07 22:40
eyeseetee9-Dec-07 22:40 
Hi
I have the following code which checks what the last number is in a database field after the _ and then adds 1 to it. however i need to add an extra bit of code in to check if a number exisits there already as the field could be: xxxx~xxx_01 or it could just be xxxx~xxx without the underscore. if its the latter then it will need to start from 1 and incrment up from there adding an underscore to the field where as at the moment it checks if there is a 1 there already,
any suggestions?
hope this makes sense, comment if not

cheers


SqlCommand cmd17 = new SqlCommand(test0002, con2);

StringBuilder htmlStr_room_code2 = new StringBuilder("");

SqlDataReader reader2 = cmd17.ExecuteReader();


while (reader2.Read())
{
htmlStr_room_code2.Append(reader2["room_code"]);
}

lbtest2.Text = htmlStr_room_code2.ToString();
Session["sessiontest1"] = lbtest2.Text.ToString();

string db = Session["sessiontest1"].ToString(); // "jh00~pr11_01";
string[] split = db.Split('_');

string s_number = split[1];
int i_number = Int32.Parse(s_number);

i_number++;
s_number = i_number.ToString();

db = split[0] + "_" + s_number;
GeneralRe: checking for a value Pin
Bekjong9-Dec-07 23:22
Bekjong9-Dec-07 23:22 
GeneralC#.NET windows services Pin
D i x y9-Dec-07 22:39
D i x y9-Dec-07 22:39 
GeneralRe: C#.NET windows services Pin
Bekjong9-Dec-07 23:31
Bekjong9-Dec-07 23:31 
GeneralRe: C#.NET windows services Pin
Ujjaval Modi10-Dec-07 0:13
Ujjaval Modi10-Dec-07 0:13 
GeneralRe: C#.NET windows services Pin
CKnig10-Dec-07 0:31
CKnig10-Dec-07 0:31 
GeneralRe: C#.NET windows services Pin
DaveyM6910-Dec-07 1:41
professionalDaveyM6910-Dec-07 1:41 
Generalc# windows control fails to load in the webpage Pin
Naveen Gowda9-Dec-07 22:13
Naveen Gowda9-Dec-07 22:13 
GeneralRe: c# windows control fails to load in the webpage Pin
Paul Conrad10-Dec-07 10:31
professionalPaul Conrad10-Dec-07 10:31 
GeneralRe: c# windows control fails to load in the webpage Pin
RichardGrimmer11-Dec-07 5:46
RichardGrimmer11-Dec-07 5:46 
GeneralRe: c# windows control fails to load in the webpage Pin
RichardGrimmer11-Dec-07 22:23
RichardGrimmer11-Dec-07 22:23 
Generalincrement by 1 problem [modified] Pin
eyeseetee9-Dec-07 22:09
eyeseetee9-Dec-07 22:09 
GeneralRe: increment by 1 problem Pin
Christian Graus9-Dec-07 22:23
protectorChristian Graus9-Dec-07 22:23 
GeneralRe: increment by 1 problem Pin
Michael Sync9-Dec-07 22:24
Michael Sync9-Dec-07 22:24 
GeneralRe: increment by 1 problem Pin
eyeseetee9-Dec-07 22:31
eyeseetee9-Dec-07 22:31 
GeneralRe: increment by 1 problem Pin
Christian Graus9-Dec-07 23:49
protectorChristian Graus9-Dec-07 23:49 
GeneralRe: increment by 1 problem Pin
N a v a n e e t h9-Dec-07 22:35
N a v a n e e t h9-Dec-07 22:35 
GeneralRe: increment by 1 problem Pin
Anthony Mushrow10-Dec-07 0:15
professionalAnthony Mushrow10-Dec-07 0:15 

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.