473,765 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binding TextBox fields to Recordset problem, "Cannot bind to the property"

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=CBR10602 911;Initial
Catalog=AccuLog ic;Persist Security Info=True;User
ID=AccuLogic;Pa ssword=acculogi c"

Dim ObjConn As New ADODB.Connectio n

Dim ObjRS As New ADODB.Recordset

Dim strRequest As String = "SELECT * FROM dbo.[WorkList]"
Public Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
With ObjConn

.ConnectionTime out = 30

.CommandTimeout = 30

.Provider = "SQLOLEDB"

.ConnectionStri ng = ConnString

End With

ObjConn.Open()

ObjRS.Open(strR equest, ObjConn,
ADODB.CursorTyp eEnum.adOpenDyn amic, ADODB.LockTypeE num.adLockReadO nly)
ObjRS.MoveFirst ()
Me.TextBox1.Tex t = ObjRS.Fields.It em(0).Value.ToS tring

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

End Sub

End Class

Oct 17 '06 #1
1 5735
It might be the crosshatch (#). Try changing the column to [AccountNo] and
see what happens.

--
Thiele Enterprises - The Power Is In Your Hands Now!

--
"mike11d11" <mi*******@yaho o.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
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=CBR10602 911;Initial
Catalog=AccuLog ic;Persist Security Info=True;User
ID=AccuLogic;Pa ssword=acculogi c"

Dim ObjConn As New ADODB.Connectio n

Dim ObjRS As New ADODB.Recordset

Dim strRequest As String = "SELECT * FROM dbo.[WorkList]"
Public Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
With ObjConn

.ConnectionTime out = 30

.CommandTimeout = 30

.Provider = "SQLOLEDB"

.ConnectionStri ng = ConnString

End With

ObjConn.Open()

ObjRS.Open(strR equest, ObjConn,
ADODB.CursorTyp eEnum.adOpenDyn amic, ADODB.LockTypeE num.adLockReadO nly)
ObjRS.MoveFirst ()
Me.TextBox1.Tex t = ObjRS.Fields.It em(0).Value.ToS tring

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

End Sub

End Class
Oct 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2043
by: Guido van Rossum | last post by:
I'm pleased to announce that the Python Software Foundation (PSF) is now accepting donations from individuals and companies interested in supporting our mission to improve the Python programming language. The PSF holds the intellectual property rights for Python and is working towards building a program to fund future Python development. Your donation will make a real difference in the quality of Python's future. For US individuals: ...
1
4041
by: VitorJOL | last post by:
Hello I have a listbox with a datasource.I want to remove a row from listbox but not remove it from the database. How can i do this ? PROBLEM:"Cannot modify the Items collection when the DataSource property is set."
4
3970
by: Bill Coan | last post by:
NOTE: This was posted earlier to vsnet.vstools.office under a different subject line but received no response. I'm having a problem automating Word's Find object from a .NET application, using late binding. If I use early binding, my code runs fine on most systems, but it is vulnerable to a known bug explained here: http://support.microsoft.com/default.aspx?scid=kb;en-us;292744
2
2666
by: ME | last post by:
If one wanted to find the documentation for Eval one would look at the documentation for DataBinder.Eval. Where would one find the documentation for the .NET 2.0 Bind method which performs two way binding? I can't seem to find any documentation on it. Thanks, Matt
3
5471
by: Ganesh Muthuvelu | last post by:
Hello, I am trying to use the new "Bind" instead of "DataBinder.Eval" but cannot see a way to use it in code. Can someone help?. Here is my code that is using "DataBinder.Eval" which I want to change to "Bind" method. Sub BindStringColumn(ByVal sender As Object, ByVal e As EventArgs) Dim lbl2 As Label = CType(sender, Label) Dim Container As DataGridItem = CType(lbl2.NamingContainer, DataGridItem) lbl2.Text =...
16
5184
by: mj.redfox.mj | last post by:
Can anyone help? I have a textbox which I'm programatically adding by using the following code: txtTest = New TextBox txtTest.ID = "txtLeft" + cntCount.ToString Page.FindControl("tdInput").Controls.Add(txtTest) This successfully creates a textbox called "txtLeft1" in the table
1
1355
by: Peter Michaux | last post by:
Hi, I saw Brendan Eich in an online conference video say that in JavaScript 2 that they will lexically bind the "this" keyword of inner functions. He said that currently the execution-time resolution of "this" is considered a bug by some. I often take advantage of the fact that "this" is resolved during execution. Is JavaScript 2 going to break all my (our?) code? For example, one time, to save typing and download time, I automated
2
1787
by: Brook | last post by:
In webform.aspx: <cc:ctlB ID="ctl1" runat="server" Width="200px" /> If set value to width property, I will get a error that say ctlB.Page is null. This control will be fine with no width property, why? Could anybody help me ? thanks ctlA.cs ----------------------------
3
1581
by: Tom | last post by:
Can someone please explain the non-working aspect of binding to Width? See code below. Thanks !! -- Tom =================================================== using System; using System.Collections.Generic;
0
9393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10153
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.