Pulling data from a specific row in dataRow using Like

Patty05

Active member
Joined
Aug 28, 2006
Messages
29
Programming Experience
Beginner
I am trying to pull values from a specific row with a select stmt in a database so I can set some variables. However, my code is not grabbing the value and I am getting the error "Index was outside the bounds of the array". I am not sure what is wrong.

VB.NET:
conn = New OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0; data source=c:\PR\Payroll.mdb")
Try
da = New OleDbDataAdapter("SELECT * FROM Hours", conn)
myDataTable = New DataTable
da.Fill(myDataSet, "Hours")
Catch ex As Exception
Console.WriteLine("Error Opening {0}", conn.DataSource)
EndTry
myCommand = New OleDbCommandBuilder(da)
 
'covert Today() to string and parse just the date to enter in database
Dim dateStr AsString = Today().ToString
Try
dateStr = FormatDateTime(dateStr, DateFormat.ShortDate)
Catch exp As Exception
MsgBox("Date not valid date format")
EndTry

 
Dim foundRows() As Data.DataRow
 
foundRows = myDataSet.Tables("Hours").Select("TodayD Like '" & dateStr & "' AND EmpNum Like '" & globalEmpNum & "'")
 
'ERROR IS HERE
globalTodayDate = foundRows(0).Item("TodayD") 'text type from database
globalTimeIn = foundRows(0).Item("TimeIn") 'date type from database
 
EndTry
Can someone please tell me what I am doing incorrectly? Is my Select stmt wrong? Is there a better way? Thanks
 
Last edited by a moderator:
There is nothing wrong with the way you are doing it. You just need to check a couple of things...

Make sure the 'strdate' variable holds the date you are looking for.

Do the same with empNum

The reason you are getting an 'Index is outside the bounds of the blah blah' exception is because your select statement isn't returning any rows. So there is either no record that matches your criteria, or the variables you are using to search are not quite right.
 
i'm curious to know why you would do this on the client rather than the database...

see, a database stores, indexes and retrieves data.. it's pretty good at it too :) this code sample retrieves the whole table into the client, then searches it there. I'm not sure why; it's akin to selecting an entire database table into an array then using a for loop to find the record you want..

why would you not jsut say

VB.NET:
New OleDBAdapter("SELECT * FROM tbl WHERE TodayD Like ? AND EmpNum Like ?")
(dont forget to add parameters at this point, to supplant the ? marks)


-
note there are two concepts in this post: one that you really should use parameters and not string concatenation to form queries, the other is that you should use the database as the query engine, not the client
 
Last edited by a moderator:
Ok.. great point cjard. Please excuse my ignorance... just learning this. I must add that this is the greatest learning experience ever!

So after setting the adapter with the SELECT stmt you suggested, I would use this code then to update????

VB.NET:
Dim foundRows() As Data.DataRow
 
foundRows = myDataSet 
 
globalTodayDate = foundRows(0).Item("TodayD") 
globalTimeIn = foundRows(0).Item("TimeIn")
 
Last edited by a moderator:
Ok.. great point cjard. Please excuse my ignorance... just learning this. I must add that this is the greatest learning experience ever!
The cynic in me can think of some other situations where I've far more enjoyed learning an unfamiliar topic of study.. :D

So after setting the adapter with the SELECT stmt you suggested, I would use this code then to update????

Dim foundRows() As Data.DataRow

foundRows = myDataSet

globalTodayDate = foundRows(0).Item("TodayD")
globalTimeIn = foundRows(0).Item("TimeIn")


Mmmh. not quite. Here's a quick up/down

DataSets have one or more DataTables
DataTables have one or more DataRows

Try and get into the habit of using datatables:
VB.NET:
myTableAdapter.Fill(myDataTable)
Rather than datasets:
VB.NET:
myTableAdapter.Fill(myDataSet, "myDataTable")

it will help you solidify the difference in your mind
-

So, we fill our dataTable with the data. If your SELECT command selects just 1 row from the database, then thats all your datatable will have..


So you'll do this:

VB.NET:
myTA.Fill(myDataTable)
 
if myDataTable.Rows.Count > 0 Then ...
 
'access the first row
myDataTable(0)("TodayD")
myDataTable(0)("TimeIn")
 
Last edited by a moderator:
cjard... I'm loving this! There is nothing more that I want in life than to master this!!! I would love to learn about the designer but I think learning the hard way first will make me appreciate the designer and how it works. Thanks so much for making this clear to me!

You wrote,
Originally Posted By Cjard
DataSets have one or more DataTables
DataTables have one or more DataRows

Try and get into the habit of using datatables:
myTableAdapter.Fill(myDataTable)

Rather than datasets:
myTableAdapter.Fill(myDataSet, "myDataTable")
That makes a ton of sense now. I guess I'm just wondering the use of having multiple data tables in a data set. If I am understanding correctly, you need to connect to db seperatly to obtain the data to fill each table, sort of like an array of tables in a dataset. What is the advantage of this when you access each table's data separatly anyways?

My next question .....

You wrote,

Originally Posted By Cjard
myTA.Fill(myDataTable)

if myDataTable.Rows.Count > 0 Then ...

'access the first row
myDataTable(0)("TodayD")
myDataTable(0)("TimeIn")
This will work great if I only have one row as you said. However, what if I have multiple rows? I know I want to loop through all of them. Lets put the values of one column in each row of the table in an array. What is the syntax for that? Something likes this??????

VB.NET:
For each myDataTable.Rows
 
myArray(i) = myDataTable(i)("TodayD")
i=i+1
 
Next


I truely appreciate your help.
 
Last edited by a moderator:
cjard... I'm loving this! There is nothing more that I want in life than to master this!!! I would love to learn about the designer but I think learning the hard way first will make me appreciate the designer and how it works. Thanks so much for making this clear to me!

You're welcome!

You wrote,

To make posts easier to read, take a look at this page:
http://vbdotnetforums.com/misc.php?do=bbcode

It will help you work out how to make my words appear in blue boxes when you want to respond to them. It makes the posts easier to read because others are not searching for what I wrote, then working out what your response is.

That makes a ton of sense now. I guess I'm just wondering the use of having multiple data tables in a data set. If I am understanding correctly, you need to connect to db seperatly to obtain the data to fill each table, sort of like an array of tables in a dataset. What is the advantage of this when you access each table's data separatly anyways?

I'll admit is seemed confusing to me at the start, but I understand better now. A DataSet is a collection of DataTables just like an ms access database is a collection of access record tables.
I use datasets to group up related stuff. Hers an example:

I have a database with a load of data tables and a load of lookup tables. the lookups map magic number values into real text. Like in the Salutation field 1 = "Mr", 2="Mrs" etc
So i have 2 datasets, one is for all the lookup tables. Why? because these tables hold no relations with my data that I will edit on my client, they can be instantiated once and filled once. Just one copy of them will be enough to service all my app's comboboxes. All the tables are similar in purpose and all go in LookupTablesDataSet.
The other tables are for data, they have relationships, they are edited and downloaded/uploaded between the database and my app. They get their own dataset. I couldm in theory, break these up into the number of DataSets as there are forms in my app. Each form only uses a handful of tables. Some forms repeat use of datatables so i find it better to use just one dataset.
My investigations showed that tables in a dataset remain set to Nothing until they are first used; i.e. they are initialized lazy, and only created when they are called on. I therefore see little performance penalty in doing things this way (we'll worry about multiple master/detail relationships later)

So, yes.. If the Relationships window of microsoft access is familiar to you then the dataset designer will be too.

The other gap in your understanding is of the way the databases are connected. You are currently doing things perfectly correctly, but in the .NET 1.1 way - use a data adapter to connect a database and fill a datatable. It seems laborious and slow, but it is actually the best performing option. MS db conenctions are designed to operate like hire cars; when you need a car/connection you go to the hire-centre/connection-pool and lease a car for your needs, then return it. The actual mechanism of this is transparent to you, but rest assured that opening and closing your db connections as aand when needed, is a good way to do things. It doesnt connect and discconect the db, merely draw from and return to apool of cached conenctions for better performance


You ask why it is done this laborious way; you havent yet seen the concept of TableAdapters. You will, when you start using the designer. A TableAdapter is a DataAdapter with connection knowledge and a number of SQL commands built in. It contains commands for sleceting one, 2, many rows from a database, updateing them(return) or deleting and inserting new ones. It can call stored procedures or return single values and it basically lets you "bring" a database table into your app. Like I say, you havent seen this yet so you might well wonder.

In with this, you can tell a dataset how tables within it are related. This means you can show related data on your forms very easily. In the tired example of Customers and Orders, the orders table every row has the customer ID showing which customer this line item belongs to, on what order number. You can call those details onto screen and see the customer's details in textboxes - just one copy of, or maybe one copy of for every address he has. and you can see in a grid below all the items he has ever ordered, on which orders etc.


I posted a sample project in this forum i think, under the thread title "Getting a datatable to show correct data" or something like that.. Have a look at it.. THATS why we use datasets; we can tell the computer HOW the data is related, in that dataset (collection of data with things in common)

This will work great if I only have one row as you said. However, what if I have multiple rows? I know I want to loop through all of them. Lets put the values of one column in each row of the table in an array. What is the syntax for that? Something likes this??????

Well, first i'd like to ask why you would do this. The column itself is already effectively an array, you can read from it, assign to it, and put it into controls like lists and combos.. so why would you do it?

However, you can skip over ANY collection that implements enumarators like this:

VB.NET:
for each listItem as ListItemType in Collection
 
 
next listItem

in tha case of a datatable:
VB.NET:
for each ro as DataRow in myDataTable.Rows
 
next ro

for a string array:
VB.NET:
for each s as String in myStringArray
 
next s


For each myDataTable.Rows

myArray(i) = myDataTable(i)("TodayD")
i=i+1

Next

It is important to remember that the coincept of numeric indexers doesnt exist with enumeration. You get a varaible RO, and on each pass of the loop it is assigned to a different value; a different datarow. There is no i=i+1 or myArray(i).

What you need to appreciate here is that arrays are fixed length and have limited purpose. you might have been raised on them because they are relatively easy to understand, but they dont fit with the notion of a colelction that can grow. Your datatable can grow without the need for resizing and copying data to the new table. Arrays cannot. Again I point out that you should question WHY you want to do this.. is it just because you feel you understand arrays, but not collections?

If you can provide an example of why you'd want an array, show me it and i will show you how to do the same thing with a collection.If i can do this enough, it will moot arrays and you will be able to start evolving your thinking with regard to them; they still have their place, but copying everything out of a dt, and into an array is something i've never done because i've never wanted to limit my flexibility as a result

I truely appreciate your help.[/quote]
 
First off.. thanks are again in order. Again I truly appreciate your time and expertise.

Secondly, I may have jumped into a project that is a bit over my head and have realized that I do not have a grasp on database programming as I once thought I had. I’ve worked with mySQL in web applications and have created desktop applications with vb.net and never had much of a problem. However, I have found working with databases in vb.net a whole new world, BUT, I will not let it beat me!

With that in mind, yes, I will admit and agree with you that I do understand arrays, but not collections and is probably the reason while I am struggling.

You asked that I provide an example of why I would want to use an array. Again, this leads back to my old school ways and probably my less than efficient coding practices in the past.

The project that I have been asked to create for work is to design a new time clock program. While I know there are many out there available that would suffice, I am not able to find one that will exactly do the job. So in a sense, I am not re-inventing the wheel, but creating a custom application for my company, which I initially thought was going to be a piece of cake!

My application currently has 1 database, Employees and Hours. They have a one to many relationship which I have set up in the msAccess database where Employee.EmpNum is primary key. In the Hours table, I have an autoNumber field set as primary key as the rest of the fields would not create a unique row. The Hours table holds EmplyeeNum, TDate, TimeIn, LunchOut, LunchIn, TimeOut and Total Hours fields.

My application successfully updates the Hours table when the user clicks the appropriate In, LunchOut, LunchIn, and Out buttons. When the Out button is clicked, it calculates the total hours for the day and updates the TotalHours field in the Hours table. That all works fine now.

Ok, with that out of the way, I am now to the point where I want to total all the hours for each employee for the 2 week pay period and this is where I planned on using arrays.

I planned on doing this (because my lack of experience does not know of any other way). The following is not tested code, as I know it will not be correct way of doing things, but will give you my ideas on how I was going to do it.

My plans were to use these arrays to create my sql statements. My code would go something like this:

VB.NET:
[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Create ArrayDates filled with each day of the 2 week pay period  (14 items)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Create ArrayEmployees filled with each employee number pulled from database (approximately 150 items)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]da = New OleDbDataAdapter(“SELECT * from Hours”, conn)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myCommand = New OleDbCommandBuilder(da)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Dim foundRows() As Data.DataRow[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Dim totalWeeklyHours, dailyHourTotal As Double[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]For Each employee in ArrayEmployees[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]          For Each date In ArrayDates   ‘this would loop 14 times, once for each day[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]foundRows = myDataSet.Tables(“Hours”).Select (“[TodayD] Like ‘” & date &  “’”)[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]‘I was then going to fill another array with the TotalHours column values and is why I was asking you how to do that.  I would then loop through the array and add the values for each to come up with a totalHourTotal for each employee for each day[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]ArrayHours[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]For dailyHourTotal in ArrayHours[/FONT]
[FONT=Verdana]totalWeeklyHours = totalWeeklyHours + dailyHourTotal[/FONT]
[FONT=Verdana]                   Next dailyHourTotal             [/FONT]
[FONT=Verdana]          [/FONT]
[FONT=Verdana]Next date [/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]                   Write dailyHourTotal to dataBase on the appropriate Employee record[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]                   dailyHourTotal = 0 ‘reset totalHours back to 0 for next employee[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]Next employee[/FONT]
[FONT=Verdana] [/FONT]
[FONT=Verdana]



There is more involved there, like calculating overtime after 40 hours for each week for each employee, etc. but you get the idea of what I planned to do. Once I have the database filled with all employee hours and other information, I them am going to create an excel spreadsheet with a bunch of info that will be uploaded to another payroll company that does our payroll (writes checks, etc) in their desired format.

So much of this is done manually in this company now with the old paper punch time clock and it drives me crazy! So because of my big mouth, I was asked to handle this project where it would all be done through this application.

Thought this would be easy, but maybe not. I’m up for the challenge but just not sure how to go about this the vb.net way.

Really appreciate your help!
 
First off.. thanks are again in order. Again I truly appreciate your time and expertise.
Welcome :)

Secondly, I may have jumped into a project that is a bit over my head and have realized that I do not have a grasp on database programming as I once thought I had.
By the end, that will change :)

I initially thought was going to be a piece of cake!
Every time i'm asked to estimate the amount of time taken for some work to be done, I multiply my initial desired response by 3, 5 if I'm using new technology. I foolishly said I could get a major financial management system done in 3 months, forgetting that I was new to VB.NET 2.0 and I should have said 5. As it is, we are 6 months down the line.. :)

And some of it has been a pig; I seem to get all the questions to which noone has an answer :)


My application currently has 1 database, Employees and Hours. They have a one to many relationship which I have set up in the msAccess database where Employee.EmpNum is primary key. In the Hours table, I have an autoNumber field set as primary key as the rest of the fields would not create a unique row.

I disagree here. I think the employee and the TimeIn DO create a unique row, if each employee can technically only clock in once per day. If you would allow multiple clockins and clockouts then I would simply have a row
That had InDate, OutDate, Task

I could then use database functions to sum them, and an employees working day might be:

empID, inDate, outDate, purpose
JON, 01/01/1901 09:00, 01/01/1901 12:00, morning work
JON, 01/01/1901 12:00, 01/01/1901 13:00, lunch
JON, 01/01/1901 09:00, , afternoon work

jons afternoon clockout is null because he is still at work. If he clocked out we update the record:

VB.NET:
UPDATE work SET outDate = Now() WHERE empID = 'JON' and OutDate IS NULL
if he clocks out but intends to return we ask him what he is doing (lunch? doc appoint?):

UPDATE work SET outDate = Now() WHERE empID = 'JON' and OutDate IS NULL;
INSERT INTO work VALUES('JON', Now(), NULL, 'doctor appointment);


that insert statement would be used to clock him in in the morning too. .so really our system relies on only 2 statements to record peoples whereabouts


My application successfully updates the Hours table when the user clicks the appropriate In, LunchOut, LunchIn, and Out buttons. When the Out button is clicked, it calculates the total hours for the day and updates the TotalHours field in the Hours table. That all works fine now.

The important point of note in any system here is that there is no need to store the total hours - you know the start, you know the end, you can run this query (against my table, imagine yours to be similar):

SELECT empID, inDate, (outDate-inDate) * 24 as HoursOnTask, purpose WHERE outDate IS NOT NULL


We'd get for my data before:
JON, 01/01/1901, 3, morning work
JON, 01/01/1901, 1,lunch


We could group these. Suppose we got the records for just this month:
VB.NET:
SELECT 
  empID, 
  (outDate-inDate) * 24 as HoursOnTask, 
  purpose
FROM 
  work
WHERE 
  outDate IS NOT NULL and 
  inDate between [I]TODAY-10[/I] AND [I]TODAY[/I]
GROUP BY 
  empID, purpose

We will leave the words in italics as an excercie for later; im, not bothered about data ranges right now.

Suppsoe jon had worked 10 mornings at 3 hours and lunched 10 times and worked 5 hours in the afternoon for 10 afternoons. we'd get this from our query:

JON, 30, morning work
JON, 10, lunch
JON, 50, afternoon work


If we dumped the purpose column off the sheet we's just get:
JON, 90

90 hours in 10 days :)



Ok, with that out of the way, I am now to the point where I want to total all the hours for each employee for the 2 week pay period and this is where I planned on using arrays.
Then have the database do it.. select all the records for the last 2 weeks, group them by employeeid, sum up the hours worked, hours lunched etc

you can even join in another table that tells us for each empID what they get paid per hour for each. You can have the database retrun you columns like overtime etc:

VB.NET:
SELECT
 empID
 CASE WHEN totalHoursWorked > 40 THEN
  40
 ELSE
  totalHoursWorked
 END as normalHours,
 CASE WHEN totalHoursWorked > 40 THEN
  totalHoursWorked - 40
 ELSE
  0
 END as overtimeHours
FROM( 
SELECT empID, sum(outTime - inTime) as totalHoursWorked
WHERE
[I]date_range_in_last_2_weeks[/I]
GROUP BY empID
)

If jon worked a cumulative of 57 hours in the last 2 weeks we get:
JON, 40, 17


I planned on doing this (because my lack of experience does not know of any other way). The following is not tested code, as I know it will not be correct way of doing things, but will give you my ideas on how I was going to do it.
Get the database to do as much donkeywork as possible, it saves a lot of messing and keeps your client side nice and clean :)

My plans were to use these arrays to create my sql statements. My code would go something like this:

I think you need to broaden your awareness of what you can get a database to do - they dont just store data, but they manipulate it, sum it up, sort it and restrict it..

There is more involved there, like calculating overtime after 40 hours for each week for each employee, etc. but you get the idea of what I planned to do.
I do.. and hopefully you can read my SQLs and go "holy cow.. it would have taken me lines and lines of code to reinvent that add-the-numbers-up wheel and cjard did it in about 45 seconds in this post!"
:D

so, get way deeper into the SQL; it can help you soo much


I them am going to create an excel spreadsheet with a bunch of info that will be uploaded to another payroll company that does our payroll (writes checks, etc) in their desired format.
I'd dump it to a CSV file - excel can open it and its easier to write opne of those than create an XLS file..


Really appreciate your help!


No problems..
 
Last edited by a moderator:
Holy Cow!!!!!!!!!!!!! :)

Incredible!!!! You make this seem soooooo easy! Why couldn't I see it this way. It makes so much sense! I'm embarassed as I know you were rolling your eyes at my ridiculous code!!!!

I am going to bag my old application and start over doing it your way. If all goes well, I should have this whole application done tommorrow (ha! yeah right!!) compared to the weeks I've been working on it the old way!

Will I have syntax problems??? Yes! Will things run smoothly?? Probably not! But I am sure off on a better foot now than I was 2 weeks ago!

I'm excited to get at this and put this application to work!

I can't thank you enough, cjard. You are amazing!
 
Lol.. I wasnt rolling my eyes, but I was sad that you'd put yourself through so much hardship :D I've been where you are, you see.. Heck, I still get where you are. You may occasionally see weird questions from me on here where i get really stuck, and sometimes I can find the answer :D

This particular time tracking wheel, I've invented last year for my own company. Ive lost the source, but I still have the memories, and it's due up for a rewrite so I'm glad to help you because it provokes my thoughts and memories too. In a way I'm helping myself write the work faster because soon I will be needing to do so. :)

Look forward to seeing what you come up with, and thanks for the feedback! It's a great encouragement for me :)
 
Well, so much for hardship.... I'm having it again! I have this 4" thick book on vb.net and ADO.NET and I am finally starting to understand the blasted thing, thanks to you cjard. However, I'm having a prob with the sql statment retrieving a date field. The SELECT stmt works fine if I pull the date fields out, but I get the dreaded error, "An unhandled exception of type 'System.ArgumentException' occurred in microsoft.visualbasic.dll
Additional information: Argument 'Prompt' cannot be converted to type 'String'." So what can I do to this select stmt to convert the dates to string? My gosh... why can't this just be simple??? lol

VB.NET:
[/SIZE]
[SIZE=2]mconCurrent.ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0; data source=\..\TimeClock\Payroll.mdb"[/SIZE]
[SIZE=2]modbcmdSelect.CommandText = "SELECT EmpNum,(OutDate-InDate)*24 As HoursOnTask, Purpose FROM HoursWorked WHERE (OutDate IS NOT NULL)GROUP BY EmpNum, Purpose"[/SIZE]
[SIZE=2]modbcmdSelect.Connection = mconCurrent[/SIZE]
[SIZE=2]modbdaCurrent.SelectCommand = modbcmdSelect[/SIZE]
 
[SIZE=2]modbdaCurrent.TableMappings.Add("Table", "tblNames")[/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2]modbdaCurrent.Fill(dsCurrent)[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] ex [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception[/SIZE]
[SIZE=2]MsgBox(ex)[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]
[/COLOR]


Thank you!
 
You dont fancy doing this the new .NET 2 way do you? I'll post a sample project...

(If you went straight into .NET2 you would not be "running before you can walk" - you'd just be solving yourself a lot of unnecessary legwork)
 

Attachments

  • VBDNF_Patty05_1.zip
    115.1 KB · Views: 33
If you review my code, you can probably see that, apart from what I did in the Form1's code everything else was written by the designer. I provided the SQLs of course..

Parameterised queries take care of a lot of the date stuff that you will encounter. Right now there is no need to get a date passed back and forth on the link. An employees ID+null_out_date is enough to uniquely identify a row if we assert that there can be at most ONE null row. THe update query will log out multiples though, so it is self healing
 
I'm sorry, I am not able to open your project. It says you have created in a newer version and cannot open it. I am using MS Visual Studio .NET 2003.

I think I am going to go into a corner and sulk...... I just don't understand why that SELECT statement will not work. It is such a simple thing I am asking that crazy adapter to do! Is there an example of a SELECT parameterised query that is similar that I would be able to use to move forward with this blasted app?

Feeling like I'm being beat... :(
 
Back
Top