Going Nuts!

S

Shelly

This ASPX/SqlServer stuff is driving me nuts.

1 - In a previous post I said I had four tables and all were showing up in
Object Explorer (MS SQL Server Management Studio Express), but when I went
to do a query using the query text editor, only two of the tables showed up.
Then, mysteriously, the problem went away. Now, it is back.

2 - My insert into a table failed from the debug version in Web Developer,
so I copied that SQL call and pasted it into SQL Server Management Program
and ran the query. It worked. I then did a select * and only that entry
showed up, not all the others. However, from my localhost website, when I
do that select all the others show up but not the new one. This tells me
that I must be looking at two different databases. The one from the site is
the same as the one outlined in Object Explorer, but query window is
connected to a different one. Try as I might, I have not been able to get
the query window one to attach to the one in Object Explorer. In that app,
the one that I want is listed as LAPTOP\SQLEXPRESS(Server 9,0.3042 -
LAPTOP\Sheldon) and then the db name. The "other one" is SQL Server
Compact Edition [MyComputer\...\thedbname]. In my app, the connection
string in the config file is "Data Source=LAPTOP\SQLEXPRESS;Initial
Catalog=thedbname;Integrated Security=True"
providerName="System.Data..SqlClient"

3 - I still can't figure out why my submit button will not fire an event if
the last event was the one fired by that submit button.

Please, someone, help me out here.

Shelly
 
S

Shelly

One more thing: The sql query window indicated that it is using
LAPTOP\SQLEXPRESS -- the correct database, the one that I want. Doing a
change_connection to that one still results in the same thing. If I do a
select * from one of the tables that show up in Object Explorer (other than
this one), it gives me "Invalid object name" -- because it doesn't have that
table.

Could this be a problem with my configuration in that I should only have one
or the other? If that is the case, how do I get rid of the Compact Edition?
Also, how do I find out where the actual database file is located?
 
G

Guest

Well,
it certainly does sound like you've got more than one of the same database
going on.
What I'd do is:

1) Script out your "best" database using the Database Publishing Wizard to a
SQL text file.

2) Remove ALL database connections from management studio including the
compact edtion.

3) scour your machine(s) for *.MDF database files and get rid of them.

4) Create a new database in the exact place where you want it - ONLY ONE.

5) execute your saved SQL script against it to recreate your database.

6) connect to the same single database from anywhere you work so you don't
run into issues.

good luck.
Peter
 
S

Shelly

OK, here is an update. Can someone please explain this to me?

I got it down to one database in the Object Explorer. When I then went into
the query editor, once again only two of the four tables showed up, and if I
queried one of them I got the wrong data.

I then went to Object Explorer and right clicked on each of the tables and
picked the "Script Table As...". Each one produced a query and each query
worked properly giving the correct data. That is for all four tables. I
then went back to the Query Editor and now all four tables show up?

What happened behind the scenes here?

Oh, I still have the second click on the button problem.

Shelly


Shelly said:
One more thing: The sql query window indicated that it is using
LAPTOP\SQLEXPRESS -- the correct database, the one that I want. Doing a
change_connection to that one still results in the same thing. If I do a
select * from one of the tables that show up in Object Explorer (other
than this one), it gives me "Invalid object name" -- because it doesn't
have that table.

Could this be a problem with my configuration in that I should only have
one or the other? If that is the case, how do I get rid of the Compact
Edition? Also, how do I find out where the actual database file is
located?


Shelly said:
This ASPX/SqlServer stuff is driving me nuts.

1 - In a previous post I said I had four tables and all were showing up
in Object Explorer (MS SQL Server Management Studio Express), but when I
went to do a query using the query text editor, only two of the tables
showed up. Then, mysteriously, the problem went away. Now, it is back.

2 - My insert into a table failed from the debug version in Web
Developer, so I copied that SQL call and pasted it into SQL Server
Management Program and ran the query. It worked. I then did a select *
and only that entry showed up, not all the others. However, from my
localhost website, when I do that select all the others show up but not
the new one. This tells me that I must be looking at two different
databases. The one from the site is the same as the one outlined in
Object Explorer, but query window is connected to a different one. Try
as I might, I have not been able to get the query window one to attach to
the one in Object Explorer. In that app, the one that I want is listed
as LAPTOP\SQLEXPRESS(Server 9,0.3042 - LAPTOP\Sheldon) and then the db
name. The "other one" is SQL Server Compact Edition
[MyComputer\...\thedbname]. In my app, the connection string in the
config file is "Data Source=LAPTOP\SQLEXPRESS;Initial
Catalog=thedbname;Integrated Security=True"
providerName="System.Data..SqlClient"

3 - I still can't figure out why my submit button will not fire an event
if the last event was the one fired by that submit button.

Please, someone, help me out here.

Shelly
 
S

Shelly

Now one more. From my code, I couldn't do the insert I wanted. I stopped
it in the debugger and copied the sql command. I then pasted that sql
command into the sql window in sql server manager and executed it. It
worked perfectly. I suspect it has to be a permissions problem. How can I
find what error was returned in the code from the attempted insert?

Shelly


Shelly said:
OK, here is an update. Can someone please explain this to me?

I got it down to one database in the Object Explorer. When I then went
into the query editor, once again only two of the four tables showed up,
and if I queried one of them I got the wrong data.

I then went to Object Explorer and right clicked on each of the tables and
picked the "Script Table As...". Each one produced a query and each query
worked properly giving the correct data. That is for all four tables. I
then went back to the Query Editor and now all four tables show up?

What happened behind the scenes here?

Oh, I still have the second click on the button problem.

Shelly


Shelly said:
One more thing: The sql query window indicated that it is using
LAPTOP\SQLEXPRESS -- the correct database, the one that I want. Doing a
change_connection to that one still results in the same thing. If I do a
select * from one of the tables that show up in Object Explorer (other
than this one), it gives me "Invalid object name" -- because it doesn't
have that table.

Could this be a problem with my configuration in that I should only have
one or the other? If that is the case, how do I get rid of the Compact
Edition? Also, how do I find out where the actual database file is
located?


Shelly said:
This ASPX/SqlServer stuff is driving me nuts.

1 - In a previous post I said I had four tables and all were showing up
in Object Explorer (MS SQL Server Management Studio Express), but when I
went to do a query using the query text editor, only two of the tables
showed up. Then, mysteriously, the problem went away. Now, it is back.

2 - My insert into a table failed from the debug version in Web
Developer, so I copied that SQL call and pasted it into SQL Server
Management Program and ran the query. It worked. I then did a select *
and only that entry showed up, not all the others. However, from my
localhost website, when I do that select all the others show up but not
the new one. This tells me that I must be looking at two different
databases. The one from the site is the same as the one outlined in
Object Explorer, but query window is connected to a different one. Try
as I might, I have not been able to get the query window one to attach
to the one in Object Explorer. In that app, the one that I want is
listed as LAPTOP\SQLEXPRESS(Server 9,0.3042 - LAPTOP\Sheldon) and then
the db name. The "other one" is SQL Server Compact Edition
[MyComputer\...\thedbname]. In my app, the connection string in the
config file is "Data Source=LAPTOP\SQLEXPRESS;Initial
Catalog=thedbname;Integrated Security=True"
providerName="System.Data..SqlClient"

3 - I still can't figure out why my submit button will not fire an event
if the last event was the one fired by that submit button.

Please, someone, help me out here.

Shelly
 
S

Shelly

I figured it out. In the catch all I had to do was add "e as Exception" and
then e.ToString() gave me the text. It works now.

I still have the second click not working.

Shelly

Shelly said:
Now one more. From my code, I couldn't do the insert I wanted. I stopped
it in the debugger and copied the sql command. I then pasted that sql
command into the sql window in sql server manager and executed it. It
worked perfectly. I suspect it has to be a permissions problem. How can
I find what error was returned in the code from the attempted insert?

Shelly


Shelly said:
OK, here is an update. Can someone please explain this to me?

I got it down to one database in the Object Explorer. When I then went
into the query editor, once again only two of the four tables showed up,
and if I queried one of them I got the wrong data.

I then went to Object Explorer and right clicked on each of the tables
and picked the "Script Table As...". Each one produced a query and each
query worked properly giving the correct data. That is for all four
tables. I then went back to the Query Editor and now all four tables
show up?

What happened behind the scenes here?

Oh, I still have the second click on the button problem.

Shelly


Shelly said:
One more thing: The sql query window indicated that it is using
LAPTOP\SQLEXPRESS -- the correct database, the one that I want. Doing a
change_connection to that one still results in the same thing. If I do
a select * from one of the tables that show up in Object Explorer (other
than this one), it gives me "Invalid object name" -- because it doesn't
have that table.

Could this be a problem with my configuration in that I should only have
one or the other? If that is the case, how do I get rid of the Compact
Edition? Also, how do I find out where the actual database file is
located?


This ASPX/SqlServer stuff is driving me nuts.

1 - In a previous post I said I had four tables and all were showing up
in Object Explorer (MS SQL Server Management Studio Express), but when
I went to do a query using the query text editor, only two of the
tables showed up. Then, mysteriously, the problem went away. Now, it
is back.

2 - My insert into a table failed from the debug version in Web
Developer, so I copied that SQL call and pasted it into SQL Server
Management Program and ran the query. It worked. I then did a select
* and only that entry showed up, not all the others. However, from my
localhost website, when I do that select all the others show up but not
the new one. This tells me that I must be looking at two different
databases. The one from the site is the same as the one outlined in
Object Explorer, but query window is connected to a different one. Try
as I might, I have not been able to get the query window one to attach
to the one in Object Explorer. In that app, the one that I want is
listed as LAPTOP\SQLEXPRESS(Server 9,0.3042 - LAPTOP\Sheldon) and then
the db name. The "other one" is SQL Server Compact Edition
[MyComputer\...\thedbname]. In my app, the connection string in the
config file is "Data Source=LAPTOP\SQLEXPRESS;Initial
Catalog=thedbname;Integrated Security=True"
providerName="System.Data..SqlClient"

3 - I still can't figure out why my submit button will not fire an
event if the last event was the one fired by that submit button.

Please, someone, help me out here.

Shelly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top