Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading information from a TableAdapter 1

Status
Not open for further replies.

SCantoria

Programmer
Sep 23, 2005
100
US
I am trying to display the information to a form using TableAdapter. I created a query GetTicketInfo(@TicketID) in the xsd. The ticket id is passed from the dashboard page.

int intTicketID = int.Parse(Request["TicketID"].ToString());

AppTableAdapter.ticketTableAdapter UpdateTicket = new AppTableAdapter.ticketTableAdapter();

UpdateTicket.GetTicketByTicketID(intTicketID);

Question:
How do I display

lblCreator.Text = ?
lblTicketType.Text = ?

Please advice.

Thanks,

Steve
 
GetTicketByTicketID should return a ticket row. so define the variable and get the associated properties. something like
Code:
TicketDataSet.TicketRow row = UpdateTicket.GetTicketByTicketID(intTicketID);
lblCreator.Text = row.Creator;
lblTicketType.Text = row.Type;

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
I ran into an error with your sample code. I found this and it worked.

NorthwindTableAdapters.ProductsTableAdapter adapter = new NorthwindTableAdapters.ProductsTableAdapter();
Northwind.ProductsDataTable products = adapter.GetDataByProductID(1);
Northwind.ProductsRow product = products[0];
string productName = product.ProductName;

Thanks for getting me started.

steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top