SqlException: Invalid object name 'UserData'

  • Thread starter Thread starter Mr.KisS
  • Start date Start date
M

Mr.KisS

Hello all,

I'm working with : WinXP PRO SP1, MS SQL 2005 Express,
Visual Web Dev 2005 Express.

I have an aspx page which must execute a stored procedure :
______________
try
{
myCommand.ExecuteNonQuery();

System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
}
catch (SqlException ex)
{
lbError.Text = ex.ToString();
}
______________

But, i get this exception :
System.Data.SqlClient.SqlException: Invalid object name
'UserData'.

But, i've never created UserData, my only stored procedure
is CreateAccount... I have made in sqlcmd :
]Changed database context to 'wizou'.
]1> GRANT EXECUTE ON [UserData] TO [KLEO\ASPNET]
]2> go
]Msg 15031, Level 16, State 1, Server KLEO\SQLEXPRESS, Line 1
]Invalid object name 'UserData'.

So if someone have any ideas, gimme ;)

Best regards.
 
You are probably missing something. By default, SQL Server 2005 Express
ships with TempDB (a temporary space for query plans, et al), Master
(metadata database) and Model (template to set up DBs). There may be some
another (forget and do not have in front of me).

There is no UserData database. I am not sure where you got the sample code
here (URL please?); knowing this might help me figure out what you are
doing.

You are also missing some declaration code in your post. You have a conn
string set up somewhere that tells which database you are looking at. That
is the DB that is missing the UserData table. Or, is this storing Session in
SQL SERVER?

In other words, there are far too many variables to do anything other than
guess.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Hi,

I have no samples. My own code.
My connectionString :
___
<connectionStrings>
<add name="AppCnxStr"
connectionString="Server=KLEO\SQLEXPRESS;Integrated
Security=True;Database=wizou"
providerName="System.Data.SqlClient" />
</connectionStrings>
___

This is the code i use :
_____________________
SqlCommand myCommand = new SqlCommand();
String strCnx =
ConfigurationSettings.ConnectionStrings["AppCnxStr"].ConnectionString.ToString();
myCommand.Connection = new SqlConnection(strCnx);
myCommand.Connection.Open();

myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "CreateAccount";

SqlParameter myNickname = new SqlParameter("@Nickname",
SqlDbType.NVarChar, 30);
myNickname.Value = boxLogin.Text;
myCommand.Parameters.Add(myNickname);

....

try
{
myCommand.ExecuteNonQuery();
System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
}
catch (SqlException ex)
{
lbError.Text = ex.ToString();
}
_______________________________________

That's all i have.

-----Original Message-----
You are probably missing something. By default, SQL Server 2005 Express
ships with TempDB (a temporary space for query plans, et al), Master
(metadata database) and Model (template to set up DBs). There may be some
another (forget and do not have in front of me).

There is no UserData database. I am not sure where you got the sample code
here (URL please?); knowing this might help me figure out what you are
doing.

You are also missing some declaration code in your post. You have a conn
string set up somewhere that tells which database you are looking at. That
is the DB that is missing the UserData table. Or, is this storing Session in
SQL SERVER?

In other words, there are far too many variables to do anything other than
guess.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Hello all,

I'm working with : WinXP PRO SP1, MS SQL 2005 Express,
Visual Web Dev 2005 Express.

I have an aspx page which must execute a stored procedure :
______________
try
{
myCommand.ExecuteNonQuery();

System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
}
catch (SqlException ex)
{
lbError.Text = ex.ToString();
}
______________

But, i get this exception :
System.Data.SqlClient.SqlException: Invalid object name
'UserData'.

But, i've never created UserData, my only stored procedure
is CreateAccount... I have made in sqlcmd :
]Changed database context to 'wizou'.
]1> GRANT EXECUTE ON [UserData] TO [KLEO\ASPNET]
]2> go
]Msg 15031, Level 16, State 1, Server KLEO\SQLEXPRESS, Line 1
]Invalid object name 'UserData'.

So if someone have any ideas, gimme ;)

Best regards.


.
 
I assume that CreateAccount accesses a table called UserData then? Is that
table created in the wizou database?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Hi,

I have no samples. My own code.
My connectionString :
___
<connectionStrings>
<add name="AppCnxStr"
connectionString="Server=KLEO\SQLEXPRESS;Integrated
Security=True;Database=wizou"
providerName="System.Data.SqlClient" />
</connectionStrings>
___

This is the code i use :
_____________________
SqlCommand myCommand = new SqlCommand();
String strCnx =
ConfigurationSettings.ConnectionStrings["AppCnxStr"].ConnectionString.ToStri
ng();
myCommand.Connection = new SqlConnection(strCnx);
myCommand.Connection.Open();

myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandText = "CreateAccount";

SqlParameter myNickname = new SqlParameter("@Nickname",
SqlDbType.NVarChar, 30);
myNickname.Value = boxLogin.Text;
myCommand.Parameters.Add(myNickname);

....

try
{
myCommand.ExecuteNonQuery();
System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
}
catch (SqlException ex)
{
lbError.Text = ex.ToString();
}
_______________________________________

That's all i have.

-----Original Message-----
You are probably missing something. By default, SQL Server 2005 Express
ships with TempDB (a temporary space for query plans, et al), Master
(metadata database) and Model (template to set up DBs). There may be some
another (forget and do not have in front of me).

There is no UserData database. I am not sure where you got the sample code
here (URL please?); knowing this might help me figure out what you are
doing.

You are also missing some declaration code in your post. You have a conn
string set up somewhere that tells which database you are looking at. That
is the DB that is missing the UserData table. Or, is this storing Session in
SQL SERVER?

In other words, there are far too many variables to do anything other than
guess.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
Hello all,

I'm working with : WinXP PRO SP1, MS SQL 2005 Express,
Visual Web Dev 2005 Express.

I have an aspx page which must execute a stored procedure :
______________
try
{
myCommand.ExecuteNonQuery();

System.Web.Security.FormsAuthentication.SetAuthCookie(boxLogin.Text,
true);
Response.Redirect("/Signup.aspx?action=Complete");
}
catch (SqlException ex)
{
lbError.Text = ex.ToString();
}
______________

But, i get this exception :
System.Data.SqlClient.SqlException: Invalid object name
'UserData'.

But, i've never created UserData, my only stored procedure
is CreateAccount... I have made in sqlcmd :
]Changed database context to 'wizou'.
]1> GRANT EXECUTE ON [UserData] TO [KLEO\ASPNET]
]2> go
]Msg 15031, Level 16, State 1, Server KLEO\SQLEXPRESS, Line 1
]Invalid object name 'UserData'.

So if someone have any ideas, gimme ;)

Best regards.


.
 
Back
Top