Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From DataTable to the column's values
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01399138
Message ID:
01399151
Views:
48
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>This should be very easy, but I could not figure this out:
>
>
>private void DisplayItemInfo(string ItemNo)
>        {
>            InventoryDS.ItemsDataTable invDt =_inventoryBiz.Find(ItemNo, null);
>
>            if (invDt.Count > 0)
>                //Show info
>            else
>              MessageBox.Show("The scanned item is not found in the inventory. Please select another item") ;
>        }
>
>
>How can I code the //Show info part?
>

Is there going to be only one record or more than one record returned?

If it's one record,
// Assuming strongly typed datatable
this.txtSomeControl.Text = invDt.ColumnName;
If it's more than one then you'll probably need to use a DataGrid on the form then bind it to the DataTable (set it's DataSource to the datatable).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform