database connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freefony
    New Member
    • Nov 2008
    • 59

    database connection

    hi am kinda of new in programming and am building my first website but am encountering some problems .
    first my connection statement i connected like this :

    Code:
    set conn=server.creatobject("sql.connection") 
    conn.open"my database".
    it ask for declearation of conn which i decleared as thus:

    Code:
     system.imports.data.sqlclient 
    public class my form (declearation expected)
    Dim conn as new sqlconnection
    Dim command as new data.sqlclient.sqlcommand
    End class
    but conn cannot be accessed cos its a private dim
    how do i make it accessible and what other codes do i need to add to both the form and the Vb to make my database accessible
    Last edited by DrBunchman; Nov 18 '08, 01:53 PM. Reason: Added [Code] Tags - Please use the '#' button
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi freefony,

    You seem to be using a mixture of Classic ASP and ASP.NET here - can you confirm which language you are intending to use?

    Thanks,

    Dr B

    Comment

    • freefony
      New Member
      • Nov 2008
      • 59

      #3
      Dr B

      Thanks Dr B am using asp.net and whenever i tried to connect its telling me overide resolution failed cannot open this number of argument pls help me

      Comment

      Working...