473,799 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Questions on Databinding

Hello

I've few questions regarding ADO & C#:

1) Is it possible to view tata from multiple tables in the Datagrid control
? Most of the examples I see are only for 1 table.

2) In Comboboxes, can we display multiple fields ? For example in a Form of
customers, we have a combo box to select the customer you want to change, so
in that combo box, when they drop down, can we have it to display "First
Name, Last Name, Customer ID, Customer type" but its databound field is
"Customer ID". I used to be able to do that in Access, C# is supposed to be
powerful but how do I do it ?

3) If you copy an access database into MSDE or SQL and it has autogenerate
fields, both in SQL & Access, how do we addresss that efficiently ?
Any insight into the above questions would be helpful & very appreciated.

Thank You
Nov 16 '05 #1
2 1217
You can view data from multiple tables in a datagrid. One way is to add a
new table to the dataset you are using that contains the columns you need.
Then fill the new table manually. If you need full functionality in the
datagrid (not only view but edit/update/delete) then you can define a custom
dataadapter.

In a similar fashion you can build a synthetic table with a select that
combines the first and last name and bind that table to the combo box.

I am not sure what your sql/access question. There are many issues with
identitiy fields and datasets; if you are copying data you sometimes need to
turn the identity field off in the sql table during the copy.

Hope this helps

"Hemang Shah" wrote:
Hello

I've few questions regarding ADO & C#:

1) Is it possible to view tata from multiple tables in the Datagrid control
? Most of the examples I see are only for 1 table.

2) In Comboboxes, can we display multiple fields ? For example in a Form of
customers, we have a combo box to select the customer you want to change, so
in that combo box, when they drop down, can we have it to display "First
Name, Last Name, Customer ID, Customer type" but its databound field is
"Customer ID". I used to be able to do that in Access, C# is supposed to be
powerful but how do I do it ?

3) If you copy an access database into MSDE or SQL and it has autogenerate
fields, both in SQL & Access, how do we addresss that efficiently ?
Any insight into the above questions would be helpful & very appreciated.

Thank You

Nov 16 '05 #2
Thank You Bob

are there any demo samples which I can look at, to understand this better ?

Thank You
"Bob1739" <Bo*****@discus sions.microsoft .com> wrote in message
news:23******** *************** ***********@mic rosoft.com...
You can view data from multiple tables in a datagrid. One way is to add a
new table to the dataset you are using that contains the columns you need.
Then fill the new table manually. If you need full functionality in the
datagrid (not only view but edit/update/delete) then you can define a
custom
dataadapter.

In a similar fashion you can build a synthetic table with a select that
combines the first and last name and bind that table to the combo box.

I am not sure what your sql/access question. There are many issues with
identitiy fields and datasets; if you are copying data you sometimes need
to
turn the identity field off in the sql table during the copy.

Hope this helps

"Hemang Shah" wrote:
Hello

I've few questions regarding ADO & C#:

1) Is it possible to view tata from multiple tables in the Datagrid
control
? Most of the examples I see are only for 1 table.

2) In Comboboxes, can we display multiple fields ? For example in a Form
of
customers, we have a combo box to select the customer you want to change,
so
in that combo box, when they drop down, can we have it to display "First
Name, Last Name, Customer ID, Customer type" but its databound field is
"Customer ID". I used to be able to do that in Access, C# is supposed to
be
powerful but how do I do it ?

3) If you copy an access database into MSDE or SQL and it has
autogenerate
fields, both in SQL & Access, how do we addresss that efficiently ?
Any insight into the above questions would be helpful & very appreciated.

Thank You

Nov 16 '05 #3

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

Similar topics

1
1390
by: Kevin | last post by:
Hi Al When I have a text box, list box, and a datagrid, how does a CurrencyManager relate to all these controls(seeing as though the datagrid uses Complex binding and textbox and list box use simple bound. So for example if I have a text box, list box and a Datagrid on a windows form, and I want to navigate the records in a dataset(and we must not forget the child records from the child tables aswell!) How do I create the CurrencyManager to...
1
1806
by: jason | last post by:
Hello everyone, I have some general questions about the DataTable object, and how it works. Moderately new to C#, I have plenty of texts describing the language, but not so much to reference ADO.NET objects (only the MSDN help files). I have written a C# Class Library that is responsible for encapsulating database information. All the objects work just fine for singleton record insert, update, select, and delete operations. But now we...
1
1446
by: ASP Yaboh | last post by:
1. If I use an ArrayList as my data source, how do I construct the accessor methods? That is, forget about properties for a moment, if I wanted the 5th item in the ArrayList, I would write the method: public string getTheField(int index) { ... } - where index would equal 4. How is this written into the property? Does reflection take care of getting the appropriate value?
3
3165
by: Kevin Swanson | last post by:
I'm writing what should be a very simple app against an Oracle database. The app has a number of user controls, any one of which is loaded into a main display page using the loadControl method, depending on which menu item a user selects. Each of these controls follows the same basic pattern: Get a dataset from the database and then display the results using basic databinding. Everything works fine except that I'll occaisionally get an...
3
956
by: Noor | last post by:
Hi everyone. Im kinda newbie to .net programming and very confused after seeing too many options for building database applicaton. I have few question for you people and want answers to them. 1) is databinding in .net a best practice? 2) what are the best practices to develop a simple database application? 3) where can i find sample application that demonstrate the best practices
2
1044
by: Dave McKie | last post by:
Hi all, I'm somewhat new the DotNet platform....I've used VB6 as well as VBA. I have a couple of basic questions: What are the majority of programmers using? Data components such as DataAdapters or connection string? SqlDataAdapters or OleDbDataAdapters?
1
1329
by: J055 | last post by:
Hi I have a Business class called User which returns a DataRow for individual user accounts using accountID as a parameter (i.e. User.Retrieve(accountID)). The ObjectDataSource doesn't complain if I attach the method to the SelectMethod property but the DetailsView does not display it properly. The returned data in the DataRow is correct. Do I need to put the DataRow back in a DataTable first or is there another way? Also, if my class...
8
2092
by: Dirk | last post by:
Hello, I have a problem to use databinding with my business layer classes. My data class does not have simple properties (string, int or datetime), instead, all my properties are objects of the generic type Field<T> (see sample code). public class Employee { public Field<stringForename
1
1635
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello to all, I want to know if DataBinding in asp.net 2,0 is better than to fill up the values of the controls of the following form: this.miControlTextBox.Text = valorParaControlTextbox; Performance with databinding is good in asp.net 2.0 ? Would you prefer: databinding or set value to Text property of control ?
2
1011
by: Mark B | last post by:
I have a Datagrid working fine, outputting: Group Most Popular Product Code -------- ------------------------------- Earth.New Zealand 32 Earth.New Zealand
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10485
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...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7565
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
6805
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
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.