Cant bind a textbox to my recordset, "Cannot bind to the property or column"??

Cant bind a textbox to my recordset, "Cannot bind to the property or column"??

Post by mike11d1 » Thu, 19 Oct 2006 07:47:46


Can anyone Tell me why this code doesnt let me bind a Textbox field to
the Account# column in my SQL table. It says "Cannot bind to the
property or column ACCOUNT# on the DataSource.
Parameter name: dataMember" I've been looking around and some people
have been using the currency manager. If this is a solution could
someone show me how I can add it to my code to make my binding work
correctly. thanks


Public Class Form1


Dim ConnString As String = "Data Source=CBR10602911;Initial
Catalog=AccuLogic;Persist Security Info=True;User
ID=AccuLogic;Password=acculogic"

Dim ObjConn As New ADODB.Connection

Dim ObjRS As New ADODB.Recordset

Dim strRequest As String = "SELECT * FROM dbo.[WorkList]"


Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
With ObjConn

.ConnectionTimeout = 30

.CommandTimeout = 30

.Provider = "SQLOLEDB"

.ConnectionString = ConnString

End With

ObjConn.Open()

ObjRS.Open(strRequest, ObjConn,
ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockReadOnly)


ObjRS.MoveFirst()
Me.TextBox1.Text = ObjRS.Fields.Item(0).Value.ToString

Me.TextBox1.DataBindings.Add("Text", ObjRS, "ACCOUNT#")

End Sub

End Class
 
 
 

Cant bind a textbox to my recordset, "Cannot bind to the property or column"??

Post by Ralp » Thu, 19 Oct 2006 12:01:15


I have a guess, but you will be better off posting in a dotNet newsgroup.
This newsgroup is for classic VB (VB6 and below). You might get a stray
answer, but best to post where dotNetters hang out.


microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.vb.controls
microsoft.public.dotnet.languages.vb.data
microsoft.public.dotnet.framework.windowsforms.controls
microsoft.public.dotnet.framework.windowsforms.databinding

-ralph