Scheduling System: VB.NET/SQL Server

jpetter7

Member
Joined
Jul 20, 2004
Messages
16
Programming Experience
Beginner
I am working on a program that will be used to check out company vehicles. Users will go online and pick out their vehicle, dates, times, etc. The problem I am having is this:
When the user clicks submit, how can I search the dataset to ensure that a vehicle is not going to be reserved by two different people at the same time?? Any ideas/ suggestions would be very much appreciated and THANK YOU in advance!
 
One quick idea is to use a second dataset and search for the selected vehicle in the DB. Obviously if the dataset returns a row, you found it and the vehicle is already reserved...

I hope this quickie answer helps.
 
Actually, that is where my problem lies... I am new to VB and don't know how to search a dataset and check for any conflicts. If you could help with that, it would be greatly appreciated. Thank you!
 
No problem, I will include a small example of what I am talking about.

I did not use sql parameters assuming you may be getting the data from text boxes or some control. You can always adapt but this should give the idea.
Also, I made a couple of assumptions about the DB you may be using.

Dim mySqlAdapter As SqlDataAdapter
Dim dsCkRsvns As DataSet
Dim myCmd As SqlCommand

myCmd = New SqlCommand
With myCmd
.CommandType = CommandType.Text
.CommandText = "Select * From Auto_Reservations Where ID = '" & Id & _
"' And ReserveDate Between ('" & beginDate & "' And '" & _
endDate & "')"
.CommandTimeout = 100
.Connection = siteCn
End With
mySqlAdapter = New SqlDataAdapter(myCmd )
dsCkSites = New DataSet
Try 'get all current Reservations for selected car
mySqlAdapter .Fill(dsCkRsvns, "Auto_Reservations")
If dsCkSites.Tables(0).Rows.Count > 0 Then
' Found car already on reserve
Else
'Continue with reservation
End If
Catch Err As Exception
'Place error trapping here, probably found no data
End Try

I hope this does the trick...

Noleman
 
Last edited:
hello jpetter,

im quite new in .NET.. currently im working on such program... (to keep on vehicles and items-inventory).. im using php+mysqlm but not satisfied with the interface... it looks like a website... i need something that look like a system and more serious (interface like VB) and googled in.. and found this forum... been thinking of VB+mySQL to develop such system... but it seems like ppl use .NET and SQL... need opinion on this.. perhaps u could post some prtscr of your system interface or provide some link to your system...

thanks
 
Re: Scheduling System: VB.NET/SQL Server Reply to Thread

I am currently using VB.NET and mySQL. It depends on your DB needs. SQL is a bigger more robust DB Server (and has a price tag that reflects that). There is a free version of SQL Server called MSDE, but it currently has a 5 user concurrent govenor on it. That means that if you have 6 or more active connections hitting the DB it will slow down.

I have looked at the new version called SQL Server Express, and I'm thinking about using it in the future.....

If you already have your data in mySQL, that would probably be your easiest solution.
 
Back
Top