Click here to Skip to main content
15,903,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Motion Blur Effect in c# Pin
Christian Graus4-Jan-07 23:49
protectorChristian Graus4-Jan-07 23:49 
AnswerRe: Motion Blur Effect in c# Pin
Stanciu Vlad5-Jan-07 1:19
Stanciu Vlad5-Jan-07 1:19 
QuestionXP Themes Pin
Russell Jones4-Jan-07 22:17
Russell Jones4-Jan-07 22:17 
AnswerRe: XP Themes Pin
Dominik Reichl4-Jan-07 22:42
Dominik Reichl4-Jan-07 22:42 
GeneralRe: XP Themes Pin
Russell Jones4-Jan-07 22:46
Russell Jones4-Jan-07 22:46 
Questionusing a namespace Pin
Member 20251764-Jan-07 21:40
Member 20251764-Jan-07 21:40 
AnswerRe: using a namespace Pin
Russell Jones4-Jan-07 21:48
Russell Jones4-Jan-07 21:48 
QuestionData validation in c# and SQL server 2000 Pin
phokojoe4-Jan-07 21:31
phokojoe4-Jan-07 21:31 
I have a windows application of which I want to validate a survey data that was captured using another software and stored in an MS SQL server 2000 database table.

eg. I have three columns , Sex, Age, Marital status

if a person is less than 20 years and is reported to be married,
I have to fire the message that is the person is too young to be married. I was able to do that in VB 6.0:
This is the code snippet that was used in vb 6.0, I had a richtextbox object where I placed all the error messages.
-------------------
Dim adoTest As New ADODB.Connection
Dim rstTest As New ADODB.Recordset
Dim adoSearch As ADODB.Recordset
Dim census, i As Integer
Private Sub cmdTest_Click()
cd.ShowSave
rtb.SaveFile cd.FileName
End Sub
Private Sub Form_Load()
adoTest.CursorLocation = adUseClient
adoTest.Provider = "MSDASQL.1"
adoTest.ConnectionString = "Password=sa;Persist Security Info=True;User ID=sa;Data Source=LSA2006;Initial Catalog=LSA2006"
adoTest.Open
If adoTest.State = adStateOpen Then
MsgBox "Connexion with the server established", vbInformation, "Testing"
Else
MsgBox "Connexion Failed !", vbInformation, "Testing"
End If
rstTest.Open "select * from table2", adoTest, adOpenDynamic, adLockOptimistic
rtb.Text = ""
While Not rstTest.EOF
If rstTest!married = 1 And rstTest!age <= 15 Then
If rtb.Text = "" Then
rtb.Text = rstTest!id
Else
rtb.Text = rtb.Text & vbNewLine & rstTest!id & " Too young to get married"
End If
End If
If rstTest!age <= 20 And rstTest!education >= 3 Then
If rtb.Text = "" Then
rtb.Text = rstTest!id
Else
rtb.Text = rtb.Text & vbNewLine & rstTest!id & " Age not consistent with education"
End If
End If
rstTest.MoveNext
Wend
End Sub

-------------
Can anybody help me how to do this in C#. I have to do data validation quicklyConfused | :confused:

Thank you

phokojoe

AnswerRe: Data validation in c# and SQL server 2000 Pin
Russell Jones4-Jan-07 22:13
Russell Jones4-Jan-07 22:13 
GeneralRe: Data validation in c# and SQL server 2000 Pin
phokojoe4-Jan-07 23:08
phokojoe4-Jan-07 23:08 
GeneralRe: Data validation in c# and SQL server 2000 Pin
Russell Jones5-Jan-07 0:31
Russell Jones5-Jan-07 0:31 
GeneralRe: Data validation in c# and SQL server 2000 Pin
phokojoe5-Jan-07 1:33
phokojoe5-Jan-07 1:33 
QuestionLimitation of FSWatcher & Windows Service Pin
Fayyaz Lodhi4-Jan-07 21:23
Fayyaz Lodhi4-Jan-07 21:23 
Questionxml reading/editing/writing Pin
divakarjmc104-Jan-07 19:37
divakarjmc104-Jan-07 19:37 
AnswerRe: xml reading/editing/writing Pin
sajid.salim.khan4-Jan-07 20:11
sajid.salim.khan4-Jan-07 20:11 
AnswerRe: xml reading/editing/writing Pin
Mircea Puiu4-Jan-07 20:43
Mircea Puiu4-Jan-07 20:43 
QuestionHow to Make EXE Pin
sajid.salim.khan4-Jan-07 19:07
sajid.salim.khan4-Jan-07 19:07 
GeneralRe: How to Make EXE Pin
Tyler454-Jan-07 19:31
Tyler454-Jan-07 19:31 
GeneralBut Sir Pin
sajid.salim.khan4-Jan-07 20:17
sajid.salim.khan4-Jan-07 20:17 
AnswerRe: But Sir Pin
Tyler454-Jan-07 20:28
Tyler454-Jan-07 20:28 
GeneralRe: But Sir Pin
sajid.salim.khan4-Jan-07 20:38
sajid.salim.khan4-Jan-07 20:38 
AnswerRe: But Sir Pin
Tyler454-Jan-07 20:58
Tyler454-Jan-07 20:58 
GeneralRe: But Sir Pin
JacquesDP4-Jan-07 20:34
JacquesDP4-Jan-07 20:34 
AnswerRe: How to Make EXE Pin
Mircea Puiu4-Jan-07 21:05
Mircea Puiu4-Jan-07 21:05 
AnswerRe: How to Make EXE Pin
Christian Graus4-Jan-07 23:58
protectorChristian Graus4-Jan-07 23:58 

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.