Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
From DataTable to the column's values
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01399138
Message ID:
01399151
Vues:
50
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform