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
What do you mean by Databound Controls Explain?
Difference between Tabletype and Snapshot?
What is the need of tabindex property is label control?
How do you change the system menu (on the Control-Menu Box)?
What type of databases you can access through ADO Data Access Object?
Is it possible to Access BackEnd procedures?
What is database vb?
How do you create a form in visual basic?
How would you use ActiveX Dll and ActiveX Exe in your application?
How can Visual Basic be used for server-side scripting?
What is rdo in vb?
How do I call help files from a VB program?
What are the types of line styles available in Treeview Control?
What is OLEDB?
What is the use of command Object?What are the various types of variables?