freelanceprogrammers.org Forum Index » ASP

Split a line using array : From Nirmal


View user's profile Post To page top
mnrajra Posted: Mon Jun 27, 2005 12:48 pm


Joined: 25 Jan 2005

Posts: 12
Split a line using array : From Nirmal
I am having the seal No like 12345 23456 34556 56777 in the single line :
LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos for
FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
vraviram Posted: Mon Jun 27, 2005 1:18 pm


Joined: 27 Jun 2005

Posts: 2
Split a line using array : From Nirmal
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.







Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :
From Nirmal



I am having the seal No like ” 12345 23456 34556 56777 ” in the single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos
for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
mnrajra Posted: Mon Jun 27, 2005 2:43 pm


Joined: 25 Jan 2005

Posts: 12
Split a line using array : From Nirmal
rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :
From Nirmal



I am having the seal No like ” 12345 23456 34556 56777 ” in the single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos
for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for
FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
vraviram Posted: Mon Jun 27, 2005 3:01 pm


Joined: 27 Jun 2005

Posts: 2
Split a line using array : From Nirmal
lblSeal1.Text = strValue.Split("")(0)
lblSeal2.Text = strValue.Split("")(1)--Error
lblSeal3.Text = strValue.Split("")(2)
Give Space
lblSeal1.Text = strValue.Split(" ")(0)
lblSeal2.Text = strValue.Split(" ")(1)
lblSeal3.Text = strValue.Split(" ")(2)








Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 03:13 PM
Please respond to AspNetAnyQuestionIsOk

To: AspNetAnyQuestionIsOk@yahoogroups.com
cc:
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
array : From Nirmal




rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :

From Nirmal



I am having the seal No like ” 12345 23456 34556 56777 ” in the
single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos

for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam
protection for FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links










[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
charlesmarkc... Posted: Mon Jun 27, 2005 4:10 pm


Joined: 07 Jan 2006

Posts: 63
Split a line using array : From Nirmal
Don`t do the split many times.

Dim strParsed() as string
strParsed=StrValue.Split(" ")
lblSeal1.Text=strParsed(0)
lblSeal1.Text=strParsed(1)
lblSeal1.Text=strParsed(2)

will perform much better. If you are getting spaces in output it is
because of doubled up spaces in string. The code below is better
approach if multiple spaces in string.

Dim strParsed() as string
Dim strTemp as string
strTemp=strValue.Replace(" "," ")
strParsed=StrTemp.Split(" ")
lblSeal1.Text=strParsed(0)
lblSeal2.Text=strParsed(1)
lblSeal3.Text=strParsed(2)




On 6/27/05, rramanujam@... <rramanujam@...> wrote:
> lblSeal1.Text = strValue.Split("")(0)
> lblSeal2.Text = strValue.Split("")(1)--Error
> lblSeal3.Text = strValue.Split("")(2)
> Give Space
> lblSeal1.Text = strValue.Split(" ")(0)
> lblSeal2.Text = strValue.Split(" ")(1)
> lblSeal3.Text = strValue.Split(" ")(2)
>
>
>
>
>
>
>
>
> Nirmal Abraham <mnrajra@...>
> Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
> 06/27/2005 03:13 PM
> Please respond to AspNetAnyQuestionIsOk
>
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> cc:
> Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
>
> array : From Nirmal
>
>
>
>
> rramanujam@... wrote:
> Dim strValue As String = Trim("12345 23456 34556 56777")
> Label1.text = Sval.Split(" ")(0)
> Label2.text = Sval.Split(" ")(1)
> Label3.text = Sval.Split(" ")(2)
> Label4.text = Sval.Split(" ")(3)
> write it more generic.
>
>
> -------------------------------------------------
>
> Sub BindEdit()
>
> Dim rs As SqlDataReader
>
> Dim seals As String
>
> Dim con As New
> SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")
>
> Dim Cmd As New SqlCommand("BL_view", con)
>
> Cmd.CommandType = CommandType.StoredProcedure
>
> With Cmd.Parameters
>
> .Add("@xRef_no1", txtRegno1.Text)
>
> End With
>
> con.Open()
>
> rs = Cmd.ExecuteReader()
>
> Session.LCID = 2057
>
> If rs.Read Then
>
> seals = rs("SealNos")--Input(123 223 567)
>
> End If
>
> Dim strValue As String = Trim(seals)
>
> lblSeal1.Text = strValue.Split("")(0)
>
> lblSeal2.Text = strValue.Split("")(1)--Error
>
> lblSeal3.Text = strValue.Split("")(2)
>
> con.Close()
>
> rs.Close()
>
> End Sub
>
> Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles txtRegno1.TextChanged
>
> BindEdit()
>
> End Sub
>
>
>
>
>
>
> Nirmal Abraham <mnrajra@...>
> Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
> 06/27/2005 01:18 PM
> Please respond to AspNetAnyQuestionIsOk
>
> To: "ASP.NET"
> <aspnetanyquestionisok@yahoogroups.com>
> cc:
> Subject: [AspNetAnyQuestionIsOk] Split a line using array :
>
> >From Nirmal
>
>
>
> I am having the seal No like ” 12345 23456 34556 56777 ” in the
>
> single
> line : LABEL.TEXT
>
>
>
> I want to split and put it in
>
> Label1.text = 12345
>
> Label2.text = 23456
>
> Label3.text = 34556
>
> Label4.text = 56777
>
>
>
> Please help me sir.
>
>
>
> ---------------------------------
> How much free photo storage do you get? Store your friends n family photos
>
> for FREE with Yahoo! Photos.
> http://in.photos.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> ---------------------------------
> YAHOO! GROUPS LINKS
>
>
> Visit your group "AspNetAnyQuestionIsOk" on the web.
>
> To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> ---------------------------------
>
>
>
>
>
> ---------------------------------
> Too much spam in your inbox? Yahoo! Mail gives you the best spam
> protection for FREE!
> http://in.mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> ________________________________
> YAHOO! GROUPS LINKS
>
>
> Visit your group "AspNetAnyQuestionIsOk" on the web.
>
> To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
> ________________________________
>
Reply with quote
Send private message
View user's profile Post To page top
mnrajra Posted: Mon Jun 27, 2005 4:53 pm


Joined: 25 Jan 2005

Posts: 12
Split a line using array : From Nirmal
Again the error : Index was outside the bounds of the array.
Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split(" ")(0)

lblSeal2.Text = strValue.Split(" ")(1) --Error : Index was outside the bounds
of the array.

lblSeal3.Text = strValue.Split(" ")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub

Please Help me sir ......................
---------------------------------------------------------

rramanujam@... wrote:
lblSeal1.Text = strValue.Split("")(0)
lblSeal2.Text = strValue.Split("")(1)--Error
lblSeal3.Text = strValue.Split("")(2)
Give Space
lblSeal1.Text = strValue.Split(" ")(0)
lblSeal2.Text = strValue.Split(" ")(1)
lblSeal3.Text = strValue.Split(" ")(2)








Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 03:13 PM
Please respond to AspNetAnyQuestionIsOk

To: AspNetAnyQuestionIsOk@yahoogroups.com
cc:
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
array : From Nirmal




rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :

From Nirmal



I am having the seal No like ” 12345 23456 34556 56777 ” in the
single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos

for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam
protection for FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links










[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------




---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
JaiprakashRamshankar.Jais Posted: Mon Jun 27, 2005 4:57 pm


Joined: 27 Jun 2005

Posts: 1
Split a line using array : From Nirmal
Pease check whether its two space " " or one space " "
After split check the size of array

-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Nirmal
Abraham
Sent: Monday, June 27, 2005 5:23 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using array : From
Nirmal


Again the error : Index was outside the bounds of the array.
Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split(" ")(0)

lblSeal2.Text = strValue.Split(" ")(1) --Error : Index was outside the bounds
of the array.

lblSeal3.Text = strValue.Split(" ")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub

Please Help me sir ......................
---------------------------------------------------------

rramanujam@... wrote:
lblSeal1.Text = strValue.Split("")(0)
lblSeal2.Text = strValue.Split("")(1)--Error
lblSeal3.Text = strValue.Split("")(2)
Give Space
lblSeal1.Text = strValue.Split(" ")(0)
lblSeal2.Text = strValue.Split(" ")(1)
lblSeal3.Text = strValue.Split(" ")(2)








Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 03:13 PM
Please respond to AspNetAnyQuestionIsOk

To: AspNetAnyQuestionIsOk@yahoogroups.com
cc:
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
array : From Nirmal




rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :

From Nirmal



I am having the seal No like â` 12345 23456 34556 56777 â` in the
single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos

for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam
protection for FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links










[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------




---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links







This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or
copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.

Visit us at http://www.cognizant.com
Reply with quote
Send private message
View user's profile Post To page top
mnrajra Posted: Tue Jun 28, 2005 10:02 am


Joined: 25 Jan 2005

Posts: 12
Split a line using array : From Nirmal
Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos") - I am having in my database - as345 dfr45 bgr56

End If

Dim SealSplit As String

SealSplit = Trim(seals)

lblSeal1.Text = SealSplit.Split(" ")(0)

lblSeal2.Text = SealSplit.Split(" ")(1)

lblSeal3.Text = SealSplit.Split(" ")(2)

con.Close()

rs.Close()

End Sub
the error : Index was outside the bounds of the array.

"Jaiswal, Jaiprakash Ramshankar (Cognizant)"
<JaiprakashRamshankar.Jaiswal@...> wrote:
Pease check whether its two space " " or one space " "
After split check the size of array

-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Nirmal
Abraham
Sent: Monday, June 27, 2005 5:23 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using array : From
Nirmal


Again the error : Index was outside the bounds of the array.
Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split(" ")(0)

lblSeal2.Text = strValue.Split(" ")(1) --Error : Index was outside the bounds
of the array.

lblSeal3.Text = strValue.Split(" ")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub

Please Help me sir ......................
---------------------------------------------------------

rramanujam@... wrote:
lblSeal1.Text = strValue.Split("")(0)
lblSeal2.Text = strValue.Split("")(1)--Error
lblSeal3.Text = strValue.Split("")(2)
Give Space
lblSeal1.Text = strValue.Split(" ")(0)
lblSeal2.Text = strValue.Split(" ")(1)
lblSeal3.Text = strValue.Split(" ")(2)








Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 03:13 PM
Please respond to AspNetAnyQuestionIsOk

To: AspNetAnyQuestionIsOk@yahoogroups.com
cc:
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
array : From Nirmal




rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :

From Nirmal



I am having the seal No like â` 12345 23456 34556 56777 â` in the
single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos

for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam
protection for FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links










[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------




---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links







This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or
copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
JaiprakashRamshankar.Jais Posted: Tue Jun 28, 2005 10:41 am


Joined: 28 Jun 2005

Posts: 1
Split a line using array : From Nirmal
Check the string "as345 dfr45 bgr56"
I think it doesn`t contains space character
Or debug your application line by line and check athe array size after split
function

-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Nirmal
Abraham
Sent: Tuesday, June 28, 2005 10:33 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: RE: [AspNetAnyQuestionIsOk] Split a line using array : From
Nirmal



Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos") - I am having in my database - as345 dfr45 bgr56

End If

Dim SealSplit As String

SealSplit = Trim(seals)

lblSeal1.Text = SealSplit.Split(" ")(0)

lblSeal2.Text = SealSplit.Split(" ")(1)

lblSeal3.Text = SealSplit.Split(" ")(2)

con.Close()

rs.Close()

End Sub
the error : Index was outside the bounds of the array.

"Jaiswal, Jaiprakash Ramshankar (Cognizant)"
<JaiprakashRamshankar.Jaiswal@...> wrote:
Pease check whether its two space " " or one space " "
After split check the size of array

-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of Nirmal
Abraham
Sent: Monday, June 27, 2005 5:23 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using array : From
Nirmal


Again the error : Index was outside the bounds of the array.
Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split(" ")(0)

lblSeal2.Text = strValue.Split(" ")(1) --Error : Index was outside the bounds
of the array.

lblSeal3.Text = strValue.Split(" ")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub

Please Help me sir ......................
---------------------------------------------------------

rramanujam@... wrote:
lblSeal1.Text = strValue.Split("")(0)
lblSeal2.Text = strValue.Split("")(1)--Error
lblSeal3.Text = strValue.Split("")(2)
Give Space
lblSeal1.Text = strValue.Split(" ")(0)
lblSeal2.Text = strValue.Split(" ")(1)
lblSeal3.Text = strValue.Split(" ")(2)








Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 03:13 PM
Please respond to AspNetAnyQuestionIsOk

To: AspNetAnyQuestionIsOk@yahoogroups.com
cc:
Subject: Re: [AspNetAnyQuestionIsOk] Split a line using
array : From Nirmal




rramanujam@... wrote:
Dim strValue As String = Trim("12345 23456 34556 56777")
Label1.text = Sval.Split(" ")(0)
Label2.text = Sval.Split(" ")(1)
Label3.text = Sval.Split(" ")(2)
Label4.text = Sval.Split(" ")(3)
write it more generic.


-------------------------------------------------

Sub BindEdit()

Dim rs As SqlDataReader

Dim seals As String

Dim con As New SqlConnection("database=bl;uid=sa;pwd=;server=lc2000")

Dim Cmd As New SqlCommand("BL_view", con)

Cmd.CommandType = CommandType.StoredProcedure

With Cmd.Parameters

.Add("@xRef_no1", txtRegno1.Text)

End With

con.Open()

rs = Cmd.ExecuteReader()

Session.LCID = 2057

If rs.Read Then

seals = rs("SealNos")--Input(123 223 567)

End If

Dim strValue As String = Trim(seals)

lblSeal1.Text = strValue.Split("")(0)

lblSeal2.Text = strValue.Split("")(1)--Error

lblSeal3.Text = strValue.Split("")(2)

con.Close()

rs.Close()

End Sub

Private Sub txtRegno1_TextChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles txtRegno1.TextChanged

BindEdit()

End Sub






Nirmal Abraham <mnrajra@...>
Sent by: AspNetAnyQuestionIsOk@yahoogroups.com
06/27/2005 01:18 PM
Please respond to AspNetAnyQuestionIsOk

To: "ASP.NET" <aspnetanyquestionisok@yahoogroups.com>
cc:
Subject: [AspNetAnyQuestionIsOk] Split a line using array :

From Nirmal



I am having the seal No like â` 12345 23456 34556 56777 â` in the
single
line : LABEL.TEXT



I want to split and put it in

Label1.text = 12345

Label2.text = 23456

Label3.text = 34556

Label4.text = 56777



Please help me sir.



---------------------------------
How much free photo storage do you get? Store your friends n family photos

for FREE with Yahoo! Photos.
http://in.photos.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links











[Non-text portions of this message have been removed]




---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Too much spam in your inbox? Yahoo! Mail gives you the best spam
protection for FREE!
http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links










[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------




---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links







This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or
copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





---------------------------------
Free antispam, antivirus and 1GB to save all your messages
Only in Yahoo! Mail: http://in.mail.yahoo.com

[Non-text portions of this message have been removed]




Yahoo! Groups Links








This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or
copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.

Visit us at http://www.cognizant.com
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help