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
Why doesn't "my string" & Chr$(13) do what I want?
How would you create Visual basic Document file?
How do you change the icon and otherwise manipulate the DOS box?
what are the types of LockEdits in DAO?
How would you map properties to controls by using ActiveX Control Interface Wizard?
Is there any way to pass a variable to a form apart from using global variables?
How do I do drag & drop between applications?
What is the use of ActiveX Documents?
How would you navigate between one document to another document in Internet Explorer ?
What is the use of debug Window?
what are the different Types of Recordsets.
Explain Default cursor Type and LockEdits type in RDO?
Difference between ActiveX Exe and Dll.
Is it possible to Manipulate data through flexgrid? Explain.
Explain about creating VB applications in excel?