VB.net visual studio 2003
In my code below, I put parenthesis behind "Dim ds As New DataSet()"
but when I change lines it removes the parenthesis
AND
dataAdapter.Fill(ds, "prog")
has squiggly lines underneath and it states "Declaration expected
What AM I doing wrong?
****************************
****************************
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
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
Dim connectionString As String = "workstation id=DOZER;packet size=4096;integrated security=SSPI;data source=Dozer;" & _
"persist security info=False;initial catalog=programmersheaven"
Dim conn As New SqlConnection(connectionString)
conn.open
Dim commandString As String = "SELECT " + _
"artId, title, topic, " + _
"article.authorId as authorId, " + _
"name, lines, dateOfPublishing " + _
"FROM " + _
"article, author " + _
"WHERE " + _
"author.authorId = article.authorId"
Dim dataAdapter As New SqlDataAdapter(commandString, conn)
'Dim ds As New DataSet
Dim ds As New System.Data.DataSet
dataAdapter.Fill(ds, "prog")
conn.close
Dim dataTable As dataTable = ds.Tables("prog")