473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem in Data binding in V.B.Net kindly help

I am having problem with value member and display member property
when I do I am receiving error "cannot create childlist for feild employees"
here is the code

Dim con As New SqlConnection("workstation id=SWAP;packet size=4096;user id=sa;data source=swap;persist security info=False;initial catalog=Northwind")
Dim adpt As New SqlDataAdapter("select * from employees", con)
Dim ds As New DataSet
adpt.Fill(ds)
DataGrid1.DataSource = ds
'DataGrid1.DataMember = "employees"


ComboBox1.DataSource = ds
ComboBox1.ValueMember = "employees.firstname"
ComboBox1.DisplayMember = "employees.lastname"
Jan 19 '07 #1
2 974
Ganon11
3,652 Expert 2GB
I'm going to move this to the .NET forum, where I think you'll have a better chance of getting help.
Jan 19 '07 #2
bplacker
121 100+
I am having problem with value member and display member property
when I do I am receiving error "cannot create childlist for feild employees"
here is the code

Dim con As New SqlConnection("workstation id=SWAP;packet size=4096;user id=sa;data source=swap;persist security info=False;initial catalog=Northwind")
Dim adpt As New SqlDataAdapter("select * from employees", con)
Dim ds As New DataSet
adpt.Fill(ds)
DataGrid1.DataSource = ds
'DataGrid1.DataMember = "employees"


ComboBox1.DataSource = ds
ComboBox1.ValueMember = "employees.firstname"
ComboBox1.DisplayMember = "employees.lastname"
I don't think you have to specify which table the data is coming from, just say ComboBox1.ValueMember = "firstname".

if this doesn't work, you might have to say
ComboBox1.ValueMember = ds.Tables(0).Columns("firstname")
Jan 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
8
by: BD | last post by:
Moving from MS Access to .Net using C# languag. Problem trying to duplicate form with structure as follows: 1. Main form 'Work Order' displayed as textboxes 2. subform 'Customers' textboxes...
5
by: raajakumars | last post by:
urgent!!!!!!! kindly please anyone help me....... actualy i am newbe to vb.net i need data to be inserted in to my table like this... sitenm cdate wrknm nowrk totwg tamiz palace...
2
by: John | last post by:
Hi I have a small app with bound controls that do not seem to be copying across the data entered into them to the underlying row for the update. This one really has me stump even though these...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.