Hello
One of the solution is creating a stored procedure in your database (SQL Server)
For example:
Create
Procedure SelectDateTime
(
@FileName as NVarChar(128),
@FilePath As NVarChar(256)
)
As
Begin
Select * From MyTable
Where MyTable.FileName = @FileName And
MyTable.FilePath = @FilePath
End
Then you execute call your Stored Procedure from VB.Net
Dim sqlConnection1 As SqlConnection = New SqlConnection("The Connection String")
Dim cmd As SqlCommand = New SqlCommand
Dim reader As SqlDataReader
cmd.CommandText = "SelectDateTime"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = sqlConnection1
cmd.Parameters.Add(New SqlParameter("@FileName", fileName))
cmd.Parameters.Add(New SqlParameter("@FilePath", filePath))
Try
sqlConnection1.Open
reader = cmd.ExecuteReader
Catch ex As Exception
Finally
sqlConnection1.Close
End Try
One of the other solutions is using ADO.Net Entity Framework.
Look at these
http://msdn.microsoft.com/en-us/data/ee712907[
^]
http://msdn.microsoft.com/en-us/data/aa937723[
^]