By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,589 Members | 1,102 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,589 IT Pros & Developers. It's quick & easy.

SqlException: Invalid object name 'UserData'

P: n/a
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.SetAuthCoo kie(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.
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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!
************************************************
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:28*****************************@phx.gbl...
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.SetAuthCoo kie(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.

Nov 18 '05 #2

P: n/a
Hi,

I have no samples. My own code.
My connectionString :
___
<connectionStrings>
<add name="AppCnxStr"
connectionString="Server=KLEO\SQLEXPRESS;Integrate d
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.SetAuthCoo kie(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 Expressships with TempDB (a temporary space for query plans, et al), Master(metadata database) and Model (template to set up DBs). There may be someanother (forget and do not have in front of me).

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

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

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

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

*********************************************** *
Think Outside the Box!
*********************************************** *
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in messagenews:28*****************************@phx.gbl...
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.SetAuthCoo kie(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.

.

Nov 18 '05 #3

P: n/a
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!
************************************************
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:28*****************************@phx.gbl...
Hi,

I have no samples. My own code.
My connectionString :
___
<connectionStrings>
<add name="AppCnxStr"
connectionString="Server=KLEO\SQLEXPRESS;Integrate d
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.SetAuthCoo kie(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 Expressships with TempDB (a temporary space for query plans, et al), Master(metadata database) and Model (template to set up DBs). There may be someanother (forget and do not have in front of me).

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

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

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

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

*********************************************** *
Think Outside the Box!
*********************************************** *
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in messagenews:28*****************************@phx.gbl...
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.SetAuthCoo kie(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.

.

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.