C# Subfile - iSeries data in a C# Grid -2 no coding (with Video)
Well almost no coding.
If you look at my previous post where I showed how to code a grid in C# using data from the iSeries we manually coded the grid, the data set and the connection. This example accomplishes the same result except you'll be done in under 5 minutes! It uses the IDE to build the grid, data set, adapter, connection and SQL command.
The video also shows how to add in the iSeries .net data components to your Visual Studio toolbox.
This post easier shown than discussed - so check out the following video.
Steps
- Create a windows form application project
- Add in the IBM dll to your references
- Add in the IBM data tools to your toolbox using Tools, Choose Toolbox items and filter 'idb2'
- Add a basic grid to your form
- Drag the iDB2Connection, IDB2Command, iDB2DataAdapter and a data set to your form
- Configure each by right clicking and selecting properties
- Double click outside the grid to bring up the code for the Load method of the form.
- Add in the following code
iDB2DataAdapter1.Fill(dataSet1);
dataGrid1.DataMember = dataSet1.Tables[0].TableName; - Run the program!
4 Comments:
I downloaded your code and works great. I added in a search feature as well. Saved me a bunch of time.
Is this update as well? How do you add CRUD controls?
Great tutorial! I'm just scratching the surface on C# / iSeries so this was nice 'n easy.
I am using visual web developer 2005 express edition. I added reference to IDB2 data provider and selected IDB2Command tool box item from .net framework components. Why the IDB2Command item is grey out (invisible) in the tool box? How to display iseries data using web control datagrid?
Post a Comment
Subscribe to Post Comments [Atom]
<< Home