473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Populate dropdown list with parameterized stored procedure.

TonFrere
Hello,
I'm building a windows form application in Visual C# using VS 2005. On my form I need to populate a combobox with Invoices# linked to the current reccord's Order# value. This means that:
- The combobox should repopulate if the user changes the value of Order#.
- The combobox should repopulate if the user moves through records (using the binding navigator.

My problem is that whenever I repopulate the combobox, it's value is reset to the top value of the list. For example, the order# 366 populates the dropdown list with values 566, 567, 568. If a user selects Invoice# 567 and save record, it will be reseted to 566 as soon as he move to the next record and go back to this one.

How it's done:
So far, I created a stored procedure in SQL server 2005 that connects to my oracle server and returns a set of invoice numbers denpending on parameter @OrderNum.

In VS, my dataset has an RMA table adapter (This is the main table, the one the Form is build on and which the bindingnavigator move through). I also have a table adapter called "Invoice" that expects a parameter and which calls the stored procedure.

On my form, I display RMA info including the curent's RMA Order# and a combobox to select one of the Invoice# linked to this Order#. The combobox is linked to the InvoiceBindingSource, has Invoice as DisplayMember and ValueMember and the current reccord's Invoice# as SelectedValue

Finally, on the OnTextChange event of the Order# text box, I have the following code:

InvoiceNum_ComboBox.DataSource = InvoiceTableAdapter.GetInvoices(OrderNum_TextBox.T ext);

Very simple to code but, the results are not as expected.

I searched MSDN but I can't find a recommended way to code this.

Any advice?
Nov 27 '07 #1
0 2715

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
1
by: Mark Goldin | last post by:
How can I populate a dropdownlist with data from a database using Microsoft.ApplicationBlocks.Data ? Thanks
2
by: Irishmaninusa | last post by:
Hello Everyone, I am populating a dropdown control from a database where the data is datetime values. In my stored procedure I am ordering them by where the most recent is at the top and the...
3
by: JIM.H. | last post by:
Hello, I have two Tables: Table1: GroupID1, GroupName1 and Table2:GroupID2, GroupName2. I have only one dropdown list (DropDownList1) in my application and through a stored procedure I want to...
1
by: Sheldon Penner | last post by:
I have been trying to build a web form using the SQL Data Adapter Configuration Wizard to create a dataset based on a parameterized stored procedure. I find that if I select "Use existing stored...
0
by: Tom | last post by:
Looking for some help with stored procedure call issues. Conceptually, I need to pass a data structure as the sole parameter to the Oracle stored procedure. Sounds simple enough....but how? ...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Javilen | last post by:
Hello, Maybe one of you can offer a possible solution to the problem I have below. The request to me is to build a dynamically populating dropdown list from a text box.(something similar to...
1
by: ellen89 | last post by:
Hi All, I am new to this field, and is using VS.2005, language is C#. 1) created a database "Test" in sql 2005, had a table "NameList", a stored proc "GetAllName" 2) created a new website,...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.