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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by Databound Controls Explain?

1428


Difference between Tabletype and Snapshot?

1482


What is the need of tabindex property is label control?

1595


How do you change the system menu (on the Control-Menu Box)?

968


What type of databases you can access through ADO Data Access Object?

1420






Is it possible to Access BackEnd procedures?

1592


What is database vb?

504


How do you create a form in visual basic?

474


How would you use ActiveX Dll and ActiveX Exe in your application?

1611


How can Visual Basic be used for server-side scripting?

539


What is rdo in vb?

539


How do I call help files from a VB program?

1004


What are the types of line styles available in Treeview Control?

1879


What is OLEDB?

1914


What is the use of command Object?What are the various types of variables?

597