Hi Arpan
Sorry for the delay in getting back to you, I've just spent the weekend in
the dentists chair having my tooth ripped out :-]
Anyhow I am assuming you are using VS 2005 here.
How I do it is as follows:
Add the connection string info into web.config - which you have now done.
Drag and drop a SqlDataSource onto your webform and
Set the following properties in the properties window:
ID - name it something like dsMyDataSource
ConnectionString - Choose your connection name from the dropdown, in this
case it should be NetDSN. This will then enter your dsn name automatically.
DataSource Mode - From the dropdown choose either DataSet or DataReader
Once you have done this you have 2 options:
1. Declare a variable in your code page to store your SQL statement in e.g.
Dim varSQL As String = "SELECT * FROM Tests"
and then add this to your dsMyDataSource at run time e.g.
Sub Page_Load(etc....
dsMyDataSource.SelectCommand = varSQL
End Sub
2. Add the SELECT Statement atribute into the HTML view of your
dsMyDataSource e.g.
SelectCommand="SELECT * FROM Tests"
I personally prefer to use option one as that gives full code separation at
runtime and you can then just reset the varSQL value for your UPDATE
command, DELETE command etc.
Hope this helps, any more questions just post on the group and I will try to
help.
Best Regards
Bren
Why do I climb mountains? Simple! because they are there
www.3peakschallenge.co.uk