Click here to Skip to main content
15,909,953 members
Home / Discussions / C#
   

C#

 
GeneralDatagrid, dataset, update, scroll Pin
Bedevian22-Jan-05 19:53
Bedevian22-Jan-05 19:53 
GeneralHooks CallWndProc to get my mouse Pin
c121hains22-Jan-05 15:43
c121hains22-Jan-05 15:43 
GeneralRe: Hooks CallWndProc to get my mouse Pin
Dennis C. Dietrich22-Jan-05 16:28
Dennis C. Dietrich22-Jan-05 16:28 
GeneralRe: Hooks CallWndProc to get my mouse Pin
c121hains24-Jan-05 16:57
c121hains24-Jan-05 16:57 
GeneralRe: Hooks CallWndProc to get my mouse Pin
Richard Schneider26-Jan-05 1:35
Richard Schneider26-Jan-05 1:35 
Generaledit,update,insert data on datagrid Pin
koochinh22-Jan-05 14:09
koochinh22-Jan-05 14:09 
GeneralChecking a string is a number Pin
Andy *M*22-Jan-05 14:03
Andy *M*22-Jan-05 14:03 
GeneralRe: Checking a string is a number Pin
Colin Angus Mackay22-Jan-05 14:38
Colin Angus Mackay22-Jan-05 14:38 
You could use a regular expression. Like this:
// This regular expression looks for any non-digit
Regex re = new System.Text.RegularExpressions.Regex(@"\D");
Match m = re.Match(someTextBox.Text);
if (!m.Success)
    // This is a number
else
    // This is NOT a number

Be careful of this - It works the opposite way round to the way you might expect. The regular expression is looking for non-digits and so the match operation is "successful" when it finds anything that is not a digit. The reason for doing it this way is that if you search for digits the Match operation will be successful so long as there is at least one digit in the string, even if the rest of the string is letters or symbols, etc.

Remember to put this at the top of your file:
using System.Text.RegularExpressions;


Does this help?


Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.

GeneralRe: Checking a string is a number Pin
Tom John24-Jan-05 0:26
Tom John24-Jan-05 0:26 
GeneralTotal Memory Usage Pin
Alex Leshinsky22-Jan-05 13:39
Alex Leshinsky22-Jan-05 13:39 
GeneralRe: Total Memory Usage Pin
Alex Leshinsky23-Jan-05 10:37
Alex Leshinsky23-Jan-05 10:37 
GeneralRe: Total Memory Usage Pin
Dennis C. Dietrich23-Jan-05 17:22
Dennis C. Dietrich23-Jan-05 17:22 
Generallocalized dateTimepicker Pin
Jassim Rahma22-Jan-05 10:19
Jassim Rahma22-Jan-05 10:19 
Generaldesign changes in runtime!!! Pin
Jassim Rahma22-Jan-05 10:17
Jassim Rahma22-Jan-05 10:17 
GeneralRe: design changes in runtime!!! Pin
spif200123-Jan-05 20:34
spif200123-Jan-05 20:34 
GeneralRe: design changes in runtime!!! Pin
Jassim Rahma25-Jan-05 1:30
Jassim Rahma25-Jan-05 1:30 
QuestionHow to scroll a windows form? Pin
E6AD22-Jan-05 10:06
E6AD22-Jan-05 10:06 
AnswerRe: How to scroll a windows form? Pin
Stefan Troschuetz23-Jan-05 0:06
Stefan Troschuetz23-Jan-05 0:06 
Generalneed beginner's treeView help Pin
SuperStruct22-Jan-05 9:03
SuperStruct22-Jan-05 9:03 
GeneralRe: need beginner's treeView help Pin
mav.northwind22-Jan-05 11:19
mav.northwind22-Jan-05 11:19 
GeneralRe: need beginner's treeView help Pin
SuperStruct26-Jan-05 5:23
SuperStruct26-Jan-05 5:23 
GeneralCreating Custom DataGrid Column Pin
Anonymous22-Jan-05 8:19
Anonymous22-Jan-05 8:19 
Generalsimple question about serviceName when developing a win service Pin
liyang yu22-Jan-05 8:10
liyang yu22-Jan-05 8:10 
GeneralRe: simple question about serviceName when developing a win service Pin
Andy Brummer23-Jan-05 19:03
sitebuilderAndy Brummer23-Jan-05 19:03 
GeneralAccess database Pin
webhay22-Jan-05 4:43
webhay22-Jan-05 4:43 

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.