Just a few points to make:
Firstly I would strongly recomend against using string concatenation to build SQL statements - they are error prone and can lead to major security holes. Either use stored procedures, or failing that at least use parameterised queries as they are a big improvement over pure stings.
Secondly I find the logic in
Code:
If Cnn.State = ConnectionState.Open Then
Cnn.Close()
Cnn.Open()
End If
Dim Cmd As New SqlCommand(SQL, Cnn)
Dim DR As SqlDataReader = Cmd.ExecuteReader
If StartReader = True Then DR.Read()
Return DR
a bit odd in how it closes the connection if it is already open. I personally would open the connection if it wasnt open or just leave it open if it was already open,
but close it when I have finished using it rather than leaving it open and then closing and re-opening it when I need it again. Be aware that only a single datareader can be active on a connection at a time, when the reader is finished close it.
I also fail to see the benefit of the StartReader parameter as in every situation Ive used a reader the logic has been
Code:
While dr.Read()
do stuff with dr
End While
dr.Close()
forcing the reader to advance a single record first seems a fairly odd idea, one likely to cause the first record to be skipped or not depending on the parameter.
Thirdly I would also consider a more obvious naming convention, SetCnn could just as easily be SetConnection which is far more readable and less likely to cause confusion down the line. Also the name of the GetDA method is not giving the true story, admittedly it does indeed return a DataAdapter; it also trashes the DataSet you pass in as a second parameter replacing it with a brand new one called "X" and populates it with the results of executing the cmd parameter
Fourthly some of the methods seem a bit redundant; do SetCnn and GetCmd really simplify the code anymore than just simply creating the command and connection objects directly?
You might find some of the information onhttp://msdn.microsoft.com/practices/Topics/patterns/default.aspx?pull=/library/en-us/dnpatterns/html/dp.asp and
http://www.microsoft.com/downloads/...0A-9877-4A7B-88EC-0426B48DF275&displaylang=en worth looking at as these discuss and give decent examples of DataAccess components.