What doesInvalid object name "MyTable" mean?
I checked the table and column names. They are both correct.
Will the error mean something else, e.g. wrong data type, or no data?
TIA,
Jeffrey
Dim strConnAsString = ConfigurationManager.ConnectionStrings("MyConnectString").ConnectionString
Dim oConnAsNew OleDbConnection(strConn)
Dim oDBCommandAsNew OleDbCommand("MyStoredProceduret", oConn)
oDBCommand.CommandType = CommandType.StoredProcedure
oDBCommand.Connection.Open()
Dim rtnValueAsString = oDBCommand.ExecuteScalar() This is the error source file
This is the SP
CREATE PROCEDURE MyStoredProcedure AS
SELECT SettingsReqSchdTimeout FROM Settings
GO
Your query may be querying the wrong table or schema.
Try this
Dim oDBCommandAsNew OleDbCommand("[DatabaseName].[DatabaseSchemaName].MyStoredProceduret", oConn)
replace the value within []
|||Do a search in your project for the wordMyTable, you must have a referencesomewhere in your code.
|||You have made a spelling mistake, that could be the error, the below stored proc name has a T on the end, but your SQL doesn't.
Dim oDBCommandAsNew OleDbCommand("MyStoredProceduret", oConn)
CREATE PROCEDUREMyStoredProcedure AS
SELECT SettingsReqSchdTimeout FROM Settings
GO
Thanks. What is [DatabaseSchemaName]? the dbo name?
I tried the "DatabaseName.MyStoredProcedure". The error msg is: wrong stored procedure name.
Any more suggestions? Thanks?
|||was the name of your stored procedure just a typo in your post? it has at on the end of it. This will cause problems... won't it?
Dim oDBCommandAsNew OleDbCommand("MyStoredProceduret", oConn)
|||'MyStoredProcedure" is not the real sp name. I just typed it to indicate a sp name.
I have checked that the real sp name is correct. Thanks.
|||I think the problem is the database owner name. How do I cnage the database name
back to dbo? Just can not remember it.
TIA,
Jeffrey
check out books online for sp_changeobjectowner
|||I have verified that the error was due to the owner of the table is not dbo,
by creating another table with the owner as dbo.
However, I still don't know how to use sp_changeobjectowner to change
the table owner to dbo. I even tried sp_changetableowner, but didn't work.
TIA,
Jeffrey
No comments:
Post a Comment