473,811 Members | 2,896 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid help, please

I am working to converta Delphi application to a C# Winform application.

Coming from the Delphi world of
1. Drop a Dataset on the form
2. Drop a Datasource on the form
3. Drop a DBGrid on the form
4. Set DBGrid's Datasource property
5. Set Datasource's Dataset property
6. Set Dataset's properties
7. Set Dataset to Active
and you're done...

What steps are required to do accompish the same in a C# Winform App???

I am finding information like this very difficult to find.
Nov 16 '05 #1
1 1191
1) Drop a DataAdapter on the Form and configure it, it'll create a
connection for you if you don't have one
2) Create a DataSet and drop it on the form
3) Drop a grid on the form and specify it's datasource
4) on Form_Load, call dataAdapter.Fil l(dataset)

There are many other ways, but assuming you only want to use the visual
tools, that should do it for you.

You'll need to call fill though when the form loads. You'll also need to
specify an event (or create a button for instance) to call
dataadapter.Upd ate so you can send the data back. If you don't know the
connection string in advance (ie you deploy this app) you can set it in the
Dynamic settings and edit it in your config file.

There's a lot of nuance here, and unless this is just a test run, I'd take a
step back and famialiarize myself with ADO.NET and DataBinding before I did
much with it.

HTH,

Bill
"The Cleaning Wonder Boy" <mrclean@p&g.co m> wrote in message
news:eq******** ******@TK2MSFTN GP12.phx.gbl...
I am working to converta Delphi application to a C# Winform application.

Coming from the Delphi world of
1. Drop a Dataset on the form
2. Drop a Datasource on the form
3. Drop a DBGrid on the form
4. Set DBGrid's Datasource property
5. Set Datasource's Dataset property
6. Set Dataset's properties
7. Set Dataset to Active
and you're done...

What steps are required to do accompish the same in a C# Winform App???

I am finding information like this very difficult to find.

Nov 16 '05 #2

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

Similar topics

5
3380
by: Prateek | last post by:
Hi, How can I change the width of a column in datagrid control? TIA Prateek
2
9931
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell (multi-select without modifier keys). I got that working fine, but I also wanted to keep rows selected after a sort, which I do by storing the row's id in an arraylist. The idea was to do the sort and then go back and re-select the rows with that...
5
1349
by: Kevin | last post by:
Hi Al I have two questions about a datagrid, I need to decide which way to go.... I have a datagrid that will show me all the entries in a table. When I click on any cell(actually I would prefer if It could rather select the whole row, where ever I click), I want the data in that datagrid to populate the corresponding textbaoxes on my form, so that the user can edit the values and save them back to the database, and the update the...
4
5360
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. Currently everything is working. I can find the updated rows/columns by parsing the posted data collection against the DataGrid DataSource. However, when there is a large amount of DataGridItems (rows) the update processing can take a while. ...
1
1724
by: Mike Speak | last post by:
On my page_load, I am populating a Datagrid through the normal manner (which works) before attempting to pick out the items in one column to use in another part of my page. This is all within page_load. Within my Datagrid I have an <ItemTemplate/> tag with a child <asp:Label/> tag. The ID on the <asp:Label/> tag is set to "lblDescription". I am using the following code to iterate over the DataGrid control and pick out the descriptions...
4
2283
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
7
15445
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output the file to a folder, and then I read it back into the dataset using the dataset1.readxml. Up to this point, everything works wonderfully. The query executes, the dataset gets populated, and I get the results displayed in the datagrid.
5
6706
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious missing here, but after 2 days I am ready to explode ! Please help. To create the Delete button I selected the grid in design view, clicked the "Columns" property and added the Delete button in the
9
2734
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
10
2976
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C 22222 D E F 33333 G H I 44444 J K L
0
9607
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
10663
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
10401
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...
1
10416
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,...
0
10138
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
9217
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
7676
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...
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
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.