ASP.NET can't connect to Database in DW CS4

PHTech

Senior Member
Joined
Aug 21, 2006
Messages
588
Reaction score
0
Location
Witbank
Hi there...

I can't seem to connect to a database when using ASP.NET VB...! When using classic ASP VBScript, everything seems to work just fine, but the moment I want to use ASP.NET VB, no database can be selected, nor can I create a new connection...

I have set up an ODBC connection to a MS Access 2003 DB, and the classic ASP pages can access it.

This ASP.NET thing is only for testing purposes, as if I manage to get everything right, I will go further with it.

Any help would be appreciated.

Regards
 
No detailed help from me but I'll always suggest writing the code instead of relying on the GUI to do the work for you. Quick Example:

Code:
Dim conn As New System.Data.SqlClient.SqlConnection 
conn.ConnectionString = "Data Source=(local)\SQLEXPRESS;Initial Catalog=yourdatabase;Integrated Security=True"

Dim sqlReader As SqlClient.SqlDataReader
        Dim cmd As New SqlClient.SqlCommand
        cmd.CommandType = CommandType.Text
        cmd.CommandText = "select distinct CountryCode from tblContinents where Continent = '" & continentName.Trim & "'"
        cmd.Connection = conn
        cmd.CommandTimeout = 150

        conn.Open()
        sqlReader = cmd.ExecuteReader()

        Do While sqlReader.Read()

            If sqlReader.HasRows Then
                'Whatever you want to do
                continentArray.Add(sqlReader.Item("CountryCode"))
            End If
        Loop
        sqlReader.Close()

Instead of SQL you're going to use ODBC connections/declarations

Hope it helps
 
Thanx...

But funny thing is, everything is setup in Dreamweaver site, but still I can't manage to create a connection. This is kinda stupid as Dreamweaver shows everything is setup: The Site is setup, The document type & The Testing server is also setup. Still I can't click the '+' sign under the database tab to create a new connection...? WTF...???

Is there something else to do with Dreamweaver CS4 for it to create a connection to a Database...?
 
And the weird part is, that with classic ASP, it is working fine... Can create a connection, etc. NOTHING with ASP.NET...?

Any suggestions...?
 
I have read on a Forum, that Dreamweaver CS4 doesn't support ASP.NET in their program. As Microsoft is constantly updating the .NET framework, Adobe can't keep track in implementing the .NET v2 framework into their software... W T F...!!!

I have been using Dreamweaver for quite a while now, and have spent so much effort and energy in purchasing the new CS4 suite, and suddenly NO ASP.NET v2 pages can be built with it... Or it can be built, but you now have to to everything with the code, and no ASP.NET GUI objects is available...

Isn't there maybe like an update or something to put the ASP.NET functionality back, without using SPRY datasets in an ASPX page...? I want to connect to a DB in an ASPX page. Would the recommendation then be me switching over to Visual Studio 2008...?
 
+1 VS.NET 2008 is awesome, especially with the latest service packs it has classic ASP intellisense back.

Also has much improved javascript intellisense.

Ditch dreamweaver, it only weaves nightmares...
 
Benefit of VS2008 - Get the free (Express) versions right from MSDN. You won't have to pay a cent and it's all legit... Also, teach yourself some C#. If you've been using VB / VB.NET up until now and are quite comfortable with it, you should be able to make the switch pretty effortlessly. The class libraries are structured pretty much the same, so it's only a syntax-switch.
 
FO has a good point. For starters, Web Developer Express 2008 should be a good fit for you. Give that a try before going further.

Of course, if you're going pro, or doing some serious development, like including other DLLs, you're going to have to go the whole hog.
 
+1 VS.NET 2008 is awesome, especially with the latest service packs it has classic ASP intellisense back.

Also has much improved javascript intellisense.

Ditch dreamweaver, it only weaves nightmares...

LOL...

I am busy downloading the VS 2008 Pro from our Volume Licensing area at Microsoft. Will give it a shot, and if its better than Dreamweaver, I will CERTAINLY ditch it, as it is giving me some serious headaches lately...

Thanx for the VS recommendation...!
 
Top
Sign up to the MyBroadband newsletter
X