How to compare inserted text in (textbox1.text) with
existing database value in (Sqldatasource1) in visual
studio 2005 ?



How to compare inserted text in (textbox1.text) with existing database value in (Sqldatasource1) i..

Answer / amol

Dim strValue As String
strValue = txtValue1.Text

Dim rstData As ADODB.Recordset
rstData = New ADODB.Recordset

rstData.Fields.Append("A",
ADODB.DataTypeEnum.adInteger, 0,
ADODB.FieldAttributeEnum.adFldKeyColumn)
rstData.Fields.Append("B",
ADODB.DataTypeEnum.adVarChar, 10,
ADODB.FieldAttributeEnum.adFldIsNullable)
'rstData.Fields.Append("C",
ADODB.DataTypeEnum.adVarChar, 0)

rstData.Open()
rstData.AddNew()
rstData.Fields("A").Value = "1"
rstData.Fields("B").Value = "Amol"
rstData.Update()
rstData.MoveFirst()
If UCase(Trim(rstData.Fields("B").Value)) =
UCase(Trim(strValue)) Then
MsgBox("True")
Else
MsgBox("False")
End If

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Visual Basic Interview Questions

Is there any way to pass a variable to a form apart from using global variables?

0 Answers  


It is possible to access Text (x.txt) files? Explain.

0 Answers  


Besides Standard Exe what are other types of projects in VB?

2 Answers  


What is the differece between the (name) and caption properties of a control?

3 Answers  


What is the use of Active Control Property?

0 Answers   HCL,






___,___ and __ are difference between image and picture controls.

0 Answers  


What methods are used for DBGrid in unbound mode?

1 Answers  


How can you Implement windows functionality in VB?

0 Answers  


How many system controls are available ?

1 Answers  


What are some methods you can use to send data from one VB executable to another one?

0 Answers  


What is visual basic used for?

0 Answers  


What is connection object in vb net?

0 Answers  


Categories