0

It's your select command, you never selected mfgID, so you cannot use it in part of the ddl. The query only has information of the UserID and the Full Name as techid. So when you ask for mfgID, it goes "what the.. what do you want? Do you want UserID or do you want techid? What is mfgID?"

You're also only selecting the user information from aspnet_users. Within the table aspnet_users, do you have a field called mfgID? If so, add it to the select statement after techid:

SelectCommand="SELECT [UserID], [FirstName]+ ' ' + [LastName] AS techid, [mfgID] FROM [aspnet_Users] WHERE [isTech] = 'True' ORDER BY [LastName], [FirstName]">
0

Ah, crap, I just noticed it was the wrong datasource. Here is the right one.

<asp:SqlDataSource 
                                                                                ID="Equipment" 
                                                                                runat="server" 
                                                                                ConnectionString="<%$ ConnectionStrings:HRIServiceConnectionString1 %>" 
                                                                                SelectCommand="SELECT a.Company, b.Description FROM Manufacturers a JOIN Equipment b ON a.mfgID=b.mfgID">
                                                                                <SelectParameters>
                                                                                <asp:ControlParameter 
                                                                                ControlID="DropDownList1"
                                                                                Name="cusID"
                                                                                PropertyName="SelectedValue" 
                                                                                Type="String" />
                                                                                </SelectParameters>
                                                                            </asp:SqlDataSource>
0

Same thing though, just add mfgID to the SELECT portion of the SelectCommand:

SelectCommand="SELECT a.Company, b.Description, a.mfgID FROM Manufacturers a JOIN Equipment b ON a.mfgID=b.mfgID">
0

getting closer... Its showing an the mfgID. I need it to show the MFG company name and Description in the ddl.

0

How long is the description? You don't want this ddl to run off the page.

Here's the code for DDL:

<asp:DropDownList ID="DropDownListEquip" runat="server" CssClass="maintext" 
                                                                                DataSourceID="Equipment" DataTextField="CompanyEqpDesc" DataValueField="mfgID">
                                                                            </asp:DropDownList>

Here's the DataSource:

<asp:SqlDataSource 
                                                                                ID="Equipment" 
                                                                                runat="server" 
                                                                                ConnectionString="<%$ ConnectionStrings:HRIServiceConnectionString1 %>" 
                                                                                SelectCommand="SELECT a.Company + ' - ' + b.Description As CompanyEqpDesc, a.mfgID FROM Manufacturers a JOIN Equipment b ON a.mfgID=b.mfgID">
                                                                                <SelectParameters>
                                                                                <asp:ControlParameter 
                                                                                ControlID="DropDownList1"
                                                                                Name="cusID"
                                                                                PropertyName="SelectedValue" 
                                                                                Type="String" />
                                                                                </SelectParameters>
                                                                            </asp:SqlDataSource>
0

It broke the page:

Server Error in '/HRIService' Application.
The data types text and varchar are incompatible in the add operator.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The data types text and varchar are incompatible in the add operator.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

0

Oh you have two different data types. You first have to convert them. Okay, here's the new select statement:

SelectCommand="SELECT CONVERT(TEXT, a.Company) + ' - ' + b.Description As CompanyEqpDesc, a.mfgID FROM Manufacturers a JOIN Equipment b ON a.mfgID=b.mfgID">
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.