error.. :(
-
any idea whats this error mean? :( Server Error in '/Te' Application. -------------------------------------------------------------------------------- Line 1: Incorrect syntax near ')'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'. Source Error: Line 28: ds = New DataSet("ColumnData") Line 29: conn.Open() Line 30: adapter.Fill(ds, "default") Line 31: conn.Close() Line 32: Return ds Source File: C:\Inetpub\wwwroot\Te\ReportClass.vb Line: 30 tks... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
any idea whats this error mean? :( Server Error in '/Te' Application. -------------------------------------------------------------------------------- Line 1: Incorrect syntax near ')'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'. Source Error: Line 28: ds = New DataSet("ColumnData") Line 29: conn.Open() Line 30: adapter.Fill(ds, "default") Line 31: conn.Close() Line 32: Return ds Source File: C:\Inetpub\wwwroot\Te\ReportClass.vb Line: 30 tks... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
this is the full function
Public Function GetColumns(ByVal table As String) As DataSet Dim sqlStr As String Dim dr As DataRow sqlStr = "SELECT COLUMN_NAME FROM(Information_Schema.Columns) WHERE (Table_Name = '" & table & "')" conn = New SqlConnection(connectionString) cmd = New SqlCommand(sqlStr, conn) adapter = New SqlDataAdapter(cmd) ds = New DataSet("ColumnData") conn.Open() adapter.Fill(ds, "default") conn.Close() Return ds End Function
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18 -
any idea whats this error mean? :( Server Error in '/Te' Application. -------------------------------------------------------------------------------- Line 1: Incorrect syntax near ')'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'. Source Error: Line 28: ds = New DataSet("ColumnData") Line 29: conn.Open() Line 30: adapter.Fill(ds, "default") Line 31: conn.Close() Line 32: Return ds Source File: C:\Inetpub\wwwroot\Te\ReportClass.vb Line: 30 tks... "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
any idea how to correct the staement??? "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
-
this is the full function
Public Function GetColumns(ByVal table As String) As DataSet Dim sqlStr As String Dim dr As DataRow sqlStr = "SELECT COLUMN_NAME FROM(Information_Schema.Columns) WHERE (Table_Name = '" & table & "')" conn = New SqlConnection(connectionString) cmd = New SqlCommand(sqlStr, conn) adapter = New SqlDataAdapter(cmd) ds = New DataSet("ColumnData") conn.Open() adapter.Fill(ds, "default") conn.Close() Return ds End Function
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18 -
First: You don't need open connection when you fill dataset, so remove line 30,31. And Second this is your problem: Remove the parantess near
Information_Schema.Columns
. Mazy You're face to face, With the man who sold the world - David BowieHe doesn't necessarily need to remove the open connection statement. If the connection hasn't been opened the DataAdapter will do so before Fill.
-
any idea how to correct the staement??? "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
SELECT COLUMN_NAME FROM Information_Schema.Columns
Free your mind...
-
He doesn't necessarily need to remove the open connection statement. If the connection hasn't been opened the DataAdapter will do so before Fill.
-
I didn't say the problem come from there, his problem is about his query, you can test it in Query Analyzer. Anyway, thank for the comment. Mazy You're face to face, With the man who sold the world - David Bowie
First: You don't need open connection when you fill dataset, so remove line 30,31. Nor did I say it was either, only pointing out that this statement isn't necessary correct.