Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using subsets of same table for different drop down list
Message
From
01/08/2006 15:22:32
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01140484
Message ID:
01142188
Views:
20
Hello Linda,

I suspect that your dataset has only one datatable in it after calling both methods. Check this the next time you run the load method. Assuming that's the case, it's because you need to use the FillDataSet overload that allows you to specify a datatable name for your query result. Calling it the way you are currently, MM.NET sets the datatable name as this.TableName for both methods and since it's the same for both, the second one overwrites the first one's datatable.

Hope that helps,
---J

>I tried this and still have no luck. I changed the query to be exactly the same as the one for the other pull down to be sure the problem wasn't the query and still get nothing. Am I setting something up wrong?
>
>I tried using a separate DataSet objects for each table but that didn't help either. In the form's load I have:
>
>
>    protected Users oUsers;
>    protected Invclass oInvclass;
>
>    /// <summary>
>    /// Page Load handler
>    /// </summary>
>    /// <param name="sender">Event source</param>
>    /// <param name="e">Event args</param>
>    protected void Page_Load(object sender, EventArgs e)
>    {
>        // Register users and get all active users/requisitioners
>        this.oUsers = (Users)this.RegisterBizObj(new Users());
>        this.oUsers.GetAllActiveUsers();
>
>        //DataSet dsApprovers = this.oUsers.GetApprovers();
>        this.oUsers.GetApprovers();
>    }
>
>
>In the business object, I have:
>
>
>        /// <summary>
>        /// Returns data set of all users who are flagged as approvers.
>        /// </summary>
>        /// <returns>Data set of approvers.</returns>
>        public DataSet GetApprovers()
>        {
>            this.FillDataSet(this.GetCurrentDataSet(), "SELECT Users.*, alltrim(lastname)+', '+alltrim(firstname) as fullname " +
>                "FROM Users WHERE Status='A'");
>            return this.GetCurrentDataSet();
>        }
>
>        /// <summary>
>        /// Returns data set of all active users.
>        /// </summary>
>        /// <returns>Data set of active users.</returns>
>        public DataSet GetAllActiveUsers()
>        {
>            this.FillDataSet(this.GetCurrentDataSet(), "SELECT Users.*, alltrim(lastname)+', '+alltrim(firstname) as fullname " +
>                "FROM Users WHERE Status='A'");
>            return this.GetCurrentDataSet();
>        }
>
>
>I set the binding source to Approvers, BindingSourceDisplayMember to fullname and BindingSourceValueMember to userid.
>
>Any suggestions?
>
>Gratefully,
>
>Linda
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform