Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Sql Table Access Error

Private Sub btnloadtable_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnloadtable.Click
Dim connectionstring As String = "server=varma;database=programmerheaven;uid=sa;pwd=sa;"
Dim conn As New SqlConnection(connectionstring)
Dim commandstring As String = "select artid,title,topic,article.authorid as authorid," + _
"name,lines,dateofpubishing from article,author where author.authorid=article.authorid"
Dim dataadapter As New SqlDataAdapter(commandstring, conn)
Dim ds As New DataSet
dataadapter.Fill(ds, "prog")
datatable = ds.Tables("prog")
currrec = 0
totalrec = datatable.Rows.Count()
fillcontrols()
End Sub


in this
dataadapter.fill(ds,"prog") is giving the following error

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.


Comments

  • fomhoirefomhoire Member Posts: 2
    : Private Sub btnloadtable_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnloadtable.Click
    : Dim connectionstring As String = "server=varma;database=programmerheaven;uid=sa;pwd=sa;"
    : Dim conn As New SqlConnection(connectionstring)
    : Dim commandstring As String = "select artid,title,topic,article.authorid as authorid," + _
    : "name,lines,dateofpubishing from article,author where author.authorid=article.authorid"
    [blue]The sql query needs to have ether the author table removed or the all the column names prefixed with table names[/blue]
    : Dim dataadapter As New SqlDataAdapter(commandstring, conn)
    : Dim ds As New DataSet
    : dataadapter.Fill(ds, "prog")
    : datatable = ds.Tables("prog")
    : currrec = 0
    : totalrec = datatable.Rows.Count()
    : fillcontrols()
    : End Sub
    :
    :
    : in this
    : dataadapter.fill(ds,"prog") is giving the following error
    :
    : An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
    :
    : Additional information: System error.
    :
    :
    :
Sign In or Register to comment.