Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi.

 

Im just taking my first steps with .net and im building a web based application. I need to hooc up to my sql server 2000 db from my application. I can see the database in the left hand window and the connection all works.

 

However,

 

I see that you use namespaces to import the classes.

 

Can someone tell me why the namespace is not "intellisensing" when I start typing "System.Data.SqlClient"?

 

I will include my longon page code to ask why I should put this.

 

If someone could provide a simple example as to how I get to my data, I would be forever grateful.

 

Andy

 


Public Class logon

   Inherits System.Web.UI.Page

   Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
   Protected WithEvents Button1 As System.Web.UI.WebControls.Button
   Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
   Protected WithEvents Label2 As System.Web.UI.WebControls.Label
   Protected WithEvents Label1 As System.Web.UI.WebControls.Label

#Region " Web Form Designer Generated Code "

   'This call is required by the Web Form Designer.
   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

   End Sub

   Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
       'CODEGEN: This method call is required by the Web Form Designer
       'Do not modify it using the code editor.
       InitializeComponent()
   End Sub

#End Region

   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       'Put user code to initialize the page here
   End Sub

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim da As sqlDataAdapter = New sqlDataAdapter()

       Dim strUsername As String
       Dim strPW As String

       strUsername = TextBox1.Text
       strPW = TextBox2.Text

       Dim strOleDb As String
       Dim cnOleDb As New OleDBConnection()



   End Sub

End Class

Posted

Where abouts?

 

Can you tell me where?

I tried adding the imports bit into the top bit where it says Inherits but it does not pick up the intellisense.

I added it into the References for the Project and it worked to a point. It does not like ExecuteReader.

  • *Experts*
Posted

What are your references (in the project)? You should have System.Data at a minimum for this to work. Then having the right Imports statements should do the trick.

 

Check the object browser (ctrl-alt-J) to see what libraries you have available. It pulls from whatever you've got referenced in the solution explorer.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...