Mechanism for matching (assigning) Job Applicants to Jobs - Three tables involved. ASP.NET 2.0, SQL, VB

Posted on 2007-03-22
Medium Priority
Last Modified: 2013-11-26
What's a good way to match Job Applicants TO Job Titles AT Work Sites?

I'm Using:  
SQL Server 2000, VS2005/VB.NET, .NET 2.0 to create a Windows Form application.

I Have: Three Tables;  
APPLICANTS (pkApplicantID, fkJobTitleID,fkWorksiteID,Name, City),
JOBTITLES (pkJobTitleID, fkWorksiteID, JobTitle, int_#OfPositions)
WORKSITES (pkWorksiteID, City)

I've tried:  
Three DataGridViews on the Windows Form, one for each Table so the user can see the Applicant's Name and (address) City, the list of Job Titles and how many Positions are available, and the Work Site (location) City.

And a ComboBox with the following databound settings:
Data Source: JobTitlesBindingSource
Display Member: JobTitle
Value Member: pkJobTitleID
Selected Value: ApplicantBindingSource - fkJobTitleID

What works:
I can scroll around in the Job Titles and click on an Applicant in the DataGridView and when I leave the row of the Applicant record the fkJobTitleID will update to the currently selected pkJobTitleID of the Job Title DataGridView.  

What doesn't work:
Save Data is not hooked up, so my updates are not written back to the database.  
I wasn't able to get the BindingNavigator to be automatically added to the form when I added the DataGridView like it was on the "Tab" below.

Something somewhere else that's related that works:
I have another set of DataGridViews for assigning a Job Coach or "Monitor" to a Worksite.  On that "Tab" I have the two DataGridVies, the ComboBox linking them on the keyMonitorID and a BindingNavigator with a "Save" button.  This works similarly to the other one.

My thoughts:
This is very cumbersome and I don't think it's a very good interface for what I'm trying to do, but I have no experience in this area and am just experimenting with methods.

What I'm trying to do:
Make a user interface to match a table full of Job Applicants to a table full of Jobs (in a table by Job Title and number of positions available for that title at a particular Worksite (a third table)).

My previous programming experience: A little HTML and very little VBA.

My deadline:  Monday (two days away)

Main questions:  
1.  Is there a better way to do this?
2.  Are there any examples available I could use to go by?

Thanks in advance for any suggestions and advice.  Some code samples wouldn't hurt either. ;-)
Question by:megnin
  • 3
  • 2

Accepted Solution

Jon_Raymond earned 2000 total points
ID: 18773450
Make a datagrid of the applicanst. Add a template field to the grind. Add a dropdown to the template field. Bind that dropdown to a list if Jobs/Job IDs. To bind you'll probably have to use the databind event of the grid and populate the dropdown there. it would be best to create an array or even an XML file of the job list data, and then use that as the source for the dropdown.

Author Comment

ID: 18774374
The largest table is the APPLICANTS table and it has only about 1700 records.  I'm just learning, so although I want to know the "best" way to do it, I'm under a short timeline, so for now I think the "easiest" way is what I need.
I wouldn't know where to begin to create an array or XML file of the job list data.  So if I can bind right to the table I think I'd rather do that right now.  Mostly due to my lack of more advanced experience and not enough time for this project to learn to do it right.

If any of the steps you outlined will not be evident to a beginner once I get started, could you point out details where I might get lost if I'm not familiar with the tools you mentioned?

Thanks for your help!


Author Comment

ID: 18775114
Okay.  I've looked and looked.  I give up.  How do you add a template field to the DataGridView?
I did mention that I'm using .NET 2.0, right?  You said "Make a datagrid"  Wasn't "datagrid" in .Net 1.0? In .Net 2.0 it's now a DataGridView and that's what I'm using.  I just assumed that was what you meant and was just calling it by the old name out of habbit.

I couldn't find anything in VS2005 in the control properties or the little arrow on the control it's self or via a Google search on how to add a template field, other than adding it programatically.


Expert Comment

ID: 18935214
In case you still need it here is an example from ASP.Net 2, You can see ASP:Label controls in this grid. Just use a dropdown control in place of the label control. You probably have to loop trough the grid rows to populate each drop down.:

                            <asp:GridView ID="dgMain" runat="server" AutoGenerateColumns="False" DataKeyNames="Report_ID" CellPadding="1" ForeColor="#333333" GridLines="Vertical" Width="100%" AllowSorting="True" PageSize="50" BorderColor="Transparent" BorderStyle="Solid" BorderWidth="2px" RowHeaderColumn="report_ID" CssClass="label">
                                    <asp:BoundField DataField="report_ID" SortExpression="report_ID" HeaderText="Report_ID" >
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                    <asp:TemplateField HeaderText="Type" SortExpression="Type">
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                            <asp:Label ID="lbl_dgType" runat="server" Text='<%# Bind("shorttype") %>' tooltip='<%# Bind("type") %>'></asp:Label>
                                    <asp:TemplateField HeaderText="Completed" SortExpression="Completiondate">
                                        <ItemStyle HorizontalAlign=Right VerticalAlign=Top Wrap=False />
                                            <asp:Label ID="lbl_dgCompleted" runat="server" Text='<%# Bind("cdate") %>'></asp:Label>
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top Wrap=False />
                                            <asp:LinkButton CssClass="button" PostBackUrl='<%# "input.aspx?rid=" & Eval("report_ID") %>' ID="hplEdit" runat="server" NavigateUrl='<%# "input.aspx?rid=" & Eval("report_ID") %>'
                                                Text="edit" ToolTip="Edit Report Properties / Upload Report Files"></asp:LinkButton>
                                    <asp:TemplateField HeaderText="Title" SortExpression="Title">
                                        <ItemStyle HorizontalAlign=Left VerticalAlign=Top />
                                            <asp:HyperLink ID="hplTitle" runat="server" NavigateUrl='<%# "details.aspx?rid=" & Eval("report_ID") %>'
                                                Text='<%# Eval("Title") %>'></asp:HyperLink>
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <RowStyle BackColor="#F7F6F3" Font-Size="Small" ForeColor="#333333" />
                                <EditRowStyle BackColor="#999999" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <PagerStyle HorizontalAlign="Center" />
                                <HeaderStyle BackColor="White" Font-Bold="True" Font-Size="X-Small" ForeColor="DimGray" VerticalAlign="Middle" />
                                <AlternatingRowStyle BackColor="White" Font-Size="Small" ForeColor="#284775" />
                                    <asp:Label ID="lbl_EmptyDataGrid" runat="server" CssClass="validation" Text="No Data Returned"></asp:Label>

Expert Comment

ID: 18935221
Also, to update the dropdown in the grid you loop through the grid and find each drop down in each row and set the valeu. This code does it for checkboxes in an ASP.Net 1.1 datagrid. But, you would likely need something similar. Though I haven't tries this in 2.0:

                Dim iRow
                With users_grid
                    If SelectAll_chk.Checked Then
                        For iRow = 0 To .Items.Count - 1
                            .SelectedIndex = iRow
                            CType(.Items(iRow).Cells(1).Controls(0).FindControl("select_chk"), CheckBox).Checked() = True
                        SelectAll_chk.Text = "Deselect All"
                        For iRow = 0 To .Items.Count - 1
                            .SelectedIndex = iRow
                            CType(.Items(iRow).Cells(1).Controls(0).FindControl("select_chk"), CheckBox).Checked() = False
                        SelectAll_chk.Text = "Select All"
                    End If
                End With

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question