473,383 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

VB.net length

jamesd0142
469 256MB
Hi i have a datagird view on my form which pulls rows from my database.
When i selected a cell how can i get the length of the string in the cell/

Selected cell contains 'james' i wud require a return of '5'

OR

how do i get the value of the selected cell?
)i can then store this in a variable and get the length of that)


i want the length of the string 'Ask some1'
thanks james
Sep 18 '07 #1
4 2063
kadghar
1,295 Expert 1GB
Hi i have a datagird view on my form which pulls rows from my database.
When i selected a cell how can i get the length of the string in the cell/

Selected cell contains 'james' i wud require a return of '5'

thanks james
Len(string)

i.e.

Len("james") would be 5.
Sep 18 '07 #2
jamesd0142
469 256MB
Len(string)

i.e.

Len("james") would be 5.
this is 1 step to far for me :P SORRY...

I need to get the value stored in the selected cell first so i can get its length.

cheers
Sep 18 '07 #3
jamesd0142
469 256MB
This works if any wants to know...


MsgBox(dgvAnswer.CurrentCell.Value)
Sep 18 '07 #4
kadghar
1,295 Expert 1GB
This works if any wants to know...


MsgBox(dgvAnswer.CurrentCell.Value)
Great!, i think you're done. To have a msgbox with the length use
msgbox (len(dgvanswer.currentcell.value))
Sep 18 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Paul | last post by:
Hi, (First apologies if this is not the most relevant place to post this but I wasn't sure of where was and I am writing my app in VB.) I'm attempting to parse a binary file for which I have...
5
by: Mitchua | last post by:
Simplified a bit, I'm parsing HTML documents to get sentences e.g. my $html = get($URL); # remove all HTML TAGs...blah blah blah @sentences = split(/\./, $html)); then I'm trying to determine the...
14
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I...
4
by: moondaddy | last post by:
Is there a asp.net validator control that validates the length of the text being entered or does everyone just write jscript for this? -- moondaddy@nospam.com
1
by: Samuel R. Neff | last post by:
Are there any differences between using Array.Length and Array.GetUpperBound(0) on a one-dimensional array? We have a team of developers and most people use Array.Length but one developer uses...
4
by: randomtalk | last post by:
hello, I'm doing an exercise in "The C Programming Language, Second Edition". I just can't get one of the first chapter problem correct (I do realize however that there are answer exist on the...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte array of zeros) The results I get using .NET with...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
14
by: Richard Maher | last post by:
Hi, Can anyone please show me a regular expression (or function or other) for padding out a string to a fixed number of bytes? At the moment I've got a var initialized to N spaces, where 'N'...
5
by: prads | last post by:
Hello, The pgm below opens a file, reads it and displays the contents and its length. However it displays a length of (length+2) and also the samplesread as (samplesread +2), where samplesread is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.