Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / March 2008

Tip: Looking for answers? Try searching our database.

Using stored procedures to get list box values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hezal - 31 Mar 2008 11:36 GMT
Hi everyone,

I am using SQL Server 2005 and I've created 2 tables - Orders and OrderItems
and so for each order I have
multiple order items.
So far I can select 3 of the orderitem details : Menu item, quantity and
comments and save it into a list box . I also have Order ID and OrderItem ID
but these 2 are outside the lsit box.  I am using a Stored Procedure to add
order item into the table but When I try to get the list box values, it
doesn't work. I don't get an error but it doesn't do anything :((

How can I get some values from the list box and combine with other parameter
to insert data into a table using C# and stored procedures ??

I am really confused and would appreciate some help.  Urgent please..

Kind regards,
Hezal.
Ekrem Önsoy - 31 Mar 2008 08:16 GMT
Well, this question looks like a programming one.

However, here' s the idea...

Get the items from your database using an SP + SQLDataReader. Make your
listbox's datasource as the reader and bind it.

Then assign to your listbox's DataTextField to the appropriate field that
comes from the DB and same for the DataValueField... That's it.

P.S.
Do not neglect using "IsPostBack" for the page. You are gonna need this for
postback thing...

Signature

Ekrem Önsoy

> Hi everyone,
>
[quoted text clipped - 18 lines]
> Kind regards,
> Hezal.
Ekrem Önsoy - 31 Mar 2008 23:52 GMT
Oops! You should bind the DR after setting DataTextField and DataValueField.

Signature

Ekrem Önsoy

> Well, this question looks like a programming one.
>
[quoted text clipped - 32 lines]
>> Kind regards,
>> Hezal.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.