|
gr8coaster329 wrote: "Object reference is not set to an instance of an object",
You'll need to give us a snippet of code around the line where the exception occurrs. The error message means that something is set to null (or Nothing ) when it shouldn't.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
i did not enter any code for it. after adding the database to the project i tried to add a table to it by right clicking on tables under the database file in the database explorer window and selecting add new table and i get that error.
- Kyle
|
|
|
|
|
reinstalling visual basic express edition solved my problem.
thanks anyways for the help
- Kyle
|
|
|
|
|
Hello,
I'm a newbie using VB and SQL server Express editions. I have a windows forms application and a Web application that need to connect to the same database (Named WebCenter). But when I try to connect to it from the Web app while running the windows forms app this error message apears:
Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\WebCenter_Data.MDF". Operating system error 32: "32(The process has no access to the file because is being used by another process).
Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\WebCenter_Log.LDF". Operating system error 32: "32(The process has no access to the file because is being used by another process.)".
Cannot open database "WebCenter" requested by the login. The login failed.
Login failed for user 'CARLOS-PC\ASPNET'.
File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\WebCenter_Log.LDF" may be incorrect.
Can anyone give me hand or point me in the right direction.
Thanks.
Pd. Please excuse my english.
Carlos.
|
|
|
|
|
Looks like your trying to open the db file directly rather than going through a ADO connection. You should be able to open almost unlimited connections to your SQL server.
Look at these for connection
http://www.codeproject.com/aspnet/SQLConnect.asp[^]
or search code project for "101 ADO"
Good luck and have fun
|
|
|
|
|
Hi Frank,
You were right. I was trying to open the same DB file twice. I had the DB attached to SQL Server Express from the Web application, but when I added the data source to my VB project the connection string tries to attach the DB file again. The only way around is to progamatically connect and retrive data from the DB without using VB Express Add New Data Source.. wizard.
Thanks for your help.
Carlos
|
|
|
|
|
How can I debug stored procedures under SQL-Server 2005. Setting breakpoint and so on....
Has anybody an idea?
Thank you!
|
|
|
|
|
Hi, I asked that same question like 100 times on this forum and got no answer!
Glad to see I'm not the only one with that problem!
To debug SQL2005 you must have Visual Studio 2005 installed. (May be a marketing gimmick, dunno)
In VS2005 open the Server Explorer,
Right Click on Data Connections, choose Add Connection...
After adding the connection choose your SPROC, right-click and select Step Into Stored Procedure.
I had to do this even using SQL2000, simply because I installed VS2005.
Unfortunately VS2005 doesn't debug too well, it freezez whenever I try to stop the debugging process and for certain SPROC it never even breaks in the code, it just executes the entire procedure!
THANKS BILL!!!
Hope you run into less trouble than I did!
Good luck!
you can't forget something you never knew...
|
|
|
|
|
Thank you for your response!
Under SQL2000 you should be able to debug stored procedures with queryanalyzer, but I was never able to set it up in right way.
I hoped that that they make steps forward in sql2005.
I will get vs2005 in a few weeks, then I will try.
Thank you!
|
|
|
|
|
hi all,
I am using SQL Server 2000. I have created a DB called 'ABC'.
but today I saw that SQL DB is in 'Suspect' Mode.
So can any one please tell me how to recover the DB?
I have a backup of suspected DB. But the problem is I can not delete/Detach the DB.
thanks in advance...
|
|
|
|
|
You could turn off SQL server and copy the backup file overtop of the existing one. That is how the place I work at now does it. You can do it from a cmd prompt.
cmd> net stop mssqlserver
cmd> <copy the file>
cmd> net start mssqlserver
Steve Maier, MCSD MCAD
|
|
|
|
|
I have one of my c# applications coded using .net framework 1.1, which works fine.
Recently I installed Visual Studio 2005 - Professional edition on the same machine
(Arter formating and reinstalling Windows 2000 with SP4) and now the above application
takes a long time to open the connection to SQL Server 7.
My connection string is as follows
"user id=sa;password=;initial catalog=FINISHED_GOODS_STOCK;data source=naturubmain;Connect Timeout=30"
Once I try to open the connection it gave me 'Time out expired' error. I set the 'Connect Time out' to 0
just to find how long does it take to open the connection. It took above 1 minute and opend the
connection.
Pls help me. Withot fixing this I will not be able to enjoy the new features of VS2005
|
|
|
|
|
It looks like your not getting a connection to your SQL server. YOu also might want to try and add an Instance name to your connection string.
"user id=sa;password=;initial catalog=FINISHED_GOODS_STOCK;data source=naturubmain\DEFAULT;Connect Timeout=30"
Try and create a test connection windows ODBC tool.
|
|
|
|
|
Thanks for your advice. Later I found the problem was with the name resolving of our network. I replaced the server name with the IP address of the server in the connection string and now its working fine.
|
|
|
|
|
scenario is as below:
1. Key in password "ADMIN" , save it in a encrpyted string , such as 'Dbsaba:+='
2. Login again with password "admin"
It's working in some server and doesn't in other server.
I wonder any where in MS SQL server will trigger this case sensitive checking.
Anyone got any idea on this?
Thanks in advance!
|
|
|
|
|
The collation sequence of the Server or column (if not using the server default) determines case sensitivity.
However, you are comparing encrypted strings, so it should always be case sensitive as a word in upper case will encrypt to a different value to the same word in lowercase.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Thanks, Colin! May i know how we can know that server or column been configured with case sensitivity? what is the command or steps?
For my case, I got no idea as both Upper case and lower case encrypted string are same. This value will passed to Stored Procedure. At server A, both (Upper & lower case) can pass the checking. While at Server B,Only 'ADMIN' can return correct value.
Thanks a lot!
|
|
|
|
|
merlynml wrote: May i know how we can know that server or column been configured with case sensitivity? what is the command or steps?
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'MyTable'
As you are storing encrypted strings I would doubt that the collation sequence in the column has anything to do with it. A plaintext string that has been encrypted properly will produce completely different encrypted strings between the plain text being lower case or upper case or a mix of case.
Perhaps you are converting the plaintext to all upper case or all lower case prior encryption.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Yes, you are right. I convert it to uppercase first before encryption.
But i just can't figure out why 1 server can accept both 'ADMIN' and 'admin', while one can't.
Thanks for make me clear with the problem.
|
|
|
|
|
Hi,
Application overview:
C++ application (Win32) connects to a MSDE database through ADO 2.6.
I've got a strange problem which has more to do with system settings of ADO/SQL Server (I assume).
A while ago I've written an application that connects to an MSDE database and executes some stored procedures. Yesterday I ran the application again and I received a message that a stored procedure failed. So I created a test application that connects to the database and executes a very basic stored procedure (only containing a "print" command) with one integer input parameter. The test application can connect and while executing the "execute" command of the ADO Command object an exception is received (not a COM exception but a global exception: catch(...)). When I remove the input parameter in the application and the stored procedure, no exception is thrown.
But here's the weird part, I've tested the application on 3 other PC's (one has the same OS as mine (meaning same version + all available updates)) and it works on all other PC's. The test application used to work on mine as well.
This is what I already tried (but didn't make any difference):
- I stopped my virusscanner and firewall
- I started every service that's on my PC (because I disabled a few a while ago)
- I created a new database with the same stored procedure
- I connected with another user
Does anybody has an idea/solution for this weird case?
Thanks in advance
|
|
|
|
|
Set default parameters on the SQL Stored Procedure and add debug SQL code to it that writes to a log table (include input values) . It sounds like your input parameters are getting corrupted.
Also check that someone hasn't created a view \ table \ usp \ udf with the same name but under a different user (applies to TSQL only).
-- modified at 7:06 Monday 10th April, 2006
|
|
|
|
|
Hi,
I added debug SQL code like you suggested, but there's no logging after executing the test application. So the stored procedure isn't even executed. But the code still works on all other PC's.
Regards
|
|
|
|
|
I solved the problem.
I installed ADO 2.8 SP1 and it works again.
|
|
|
|
|
I want to get the primary Key of the selected row in DataGridView when double clicked ...
You know in .net 1.1 we had a datagrid with DataKeyField property to save a special field of table like primary key field. but in DataGrid 2.0 or in DataGridView 2.0 this property disapeared...
Now! how can I get PK when a row selected ?
|
|
|
|
|
I'm using DataGrid 2.0, and I'm pretty sure that "DataKeyField" property still exists in DataGrid 2.0 .
Was it a cat I saw?
|
|
|
|