Showing posts with label apps. Show all posts
Showing posts with label apps. Show all posts

Thursday, March 22, 2012

Can not connect to database

I am new to windows apps in .net 2.0. I am trying to create a windows service that will connect to a database and email info out to people that have had status changes.

Right now, I can not connect to the database. Here is the connection string:

Private cnnAsNew SqlClient.SqlConnection("Data Source=IPAddress;Initial Catalog=TheServer;Persist Security Info=True;User ID=userid;Password=password provider=SQLOLEDB.1;connect timeout=3600")

This is how I am trying to connect:

cnn.Open()

myCMD.CommandTimeout = 0

dr = myCMD.ExecuteReader

I keep getting an error message that I can not be logged on. I know that the credentials are correct because I use them for the web app. Something has to be wrong with my connection string, but what?

Thanks,

enak

Seehttp://www.connectionstrings.com for examples of properly formatted connection strings. You do not need the "provider" parameter, and if you did it should be separated from the other parameters by a semicolon (not a space).

If you are still having trouble you should post the exact error message (or better yet, first search the forums or Google for that error message).|||Took out the provider and it worked. Thanks.sql

Monday, March 19, 2012

Can multiple apps connect to the same database?

I have an application that was developed under Visual Basic .NET 2005 Standard that I keep continuously running to monitor and gather data and store that data in a SQL Server Express database. This is all done on a single computer that's not networked to anything. The trouble is, I'd like to look at the data in the database from time to time without shutting down the application, but I'm not able to do so. If I try to copy the database files, named lamination.mdf and lamination.ldf, to another location, I get the following error message;

"Cannot copy lamination: There has been a sharing violation. The source or destination file may be in use."

I would like to be able to copy the file to my office computer where it would be convenient to use Management Studio Express to look at the database tables. I can't even use Management Studio Express on the computer where the application is running, as I get the following message when I try to attach the database:

"CREATE FILE encountered operating system error 32(The process cannot access the file because it is being used by another process.) while attempting to open or create the physical file 'C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf'. (Microsoft SQL Server, Error: 5123)"

Here is the connection string in the VB application:

"Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf";Integrated Security=True;User Instance=True"

In the VB app, connections to the database are made only every few minutes, and the connections are immediately closed.

Is there anyway I can either copy the database files, or at least look at the database tables with Management Studio Express without stopping the VB application?

Thanks,

Tim

Multiple connections to user instances are not possible. Attach the database to the Express instances to make that possible.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de
|||

Jens, I'm confused. You say that multiple connections to user instances are not possible, but then you say to attach the database to the Express intances to make that possible. Is it possible or not? And if it is possible, could you go into more detail to explain how?

Thanks,

Tim

|||You'd need to shut down SQL before you can copy the files.|||I would suggest reading something about the priciples of user instance and regular SQl Server instances. SQL Server instances are permanatly attached to the SQL Server service, while user instances are only attached during the usage of any application. If one application gains access to the file, it is opened exclusivly for the user, therefore cannot be opened through another user instance connection. The Server permanently attached file on the other site will allow though the service to handle multiple user requests.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||I would be careful which such assumptions. Sure the files can be copied during the usage, but shutting down SQL Server will make the datafile be consistent. If you do not shut down the server service, the information of datafile and logfile can differ making the database after a restore inaccessible. So the better way would be to shutdown the service and therefore close the files.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlexprbol/html/0bd6143a-ca9d-4f36-ae23-bd35a2d22d70.htm

Basically, the application needs to be running first, and then you connect to the user instance with a named pipe protocol. However, the Select statement they use in the example didn't work for me as is;

Select owning_principle_name, instance_pipe_name from sys.dm_os_child_instances

I had to drop the field names and use this

Select * from sys.dm_os_child_instances

Then, from the new connection listed in the object explorer I drilled down to the folder containing the user instance database (the folder name having the same path as my application's database) and was able to "manage objects related to your user instance" as they put it.

Tim

Can multiple apps connect to the same database?

I have an application that was developed under Visual Basic .NET 2005 Standard that I keep continuously running to monitor and gather data and store that data in a SQL Server Express database. This is all done on a single computer that's not networked to anything. The trouble is, I'd like to look at the data in the database from time to time without shutting down the application, but I'm not able to do so. If I try to copy the database files, named lamination.mdf and lamination.ldf, to another location, I get the following error message;

"Cannot copy lamination: There has been a sharing violation. The source or destination file may be in use."

I would like to be able to copy the file to my office computer where it would be convenient to use Management Studio Express to look at the database tables. I can't even use Management Studio Express on the computer where the application is running, as I get the following message when I try to attach the database:

"CREATE FILE encountered operating system error 32(The process cannot access the file because it is being used by another process.) while attempting to open or create the physical file 'C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf'. (Microsoft SQL Server, Error: 5123)"

Here is the connection string in the VB application:

"Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf";Integrated Security=True;User Instance=True"

In the VB app, connections to the database are made only every few minutes, and the connections are immediately closed.

Is there anyway I can either copy the database files, or at least look at the database tables with Management Studio Express without stopping the VB application?

Thanks,

Tim

Multiple connections to user instances are not possible. Attach the database to the Express instances to make that possible.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

Jens, I'm confused. You say that multiple connections to user instances are not possible, but then you say to attach the database to the Express intances to make that possible. Is it possible or not? And if it is possible, could you go into more detail to explain how?

Thanks,

Tim

|||You'd need to shut down SQL before you can copy the files.|||I would suggest reading something about the priciples of user instance and regular SQl Server instances. SQL Server instances are permanatly attached to the SQL Server service, while user instances are only attached during the usage of any application. If one application gains access to the file, it is opened exclusivly for the user, therefore cannot be opened through another user instance connection. The Server permanently attached file on the other site will allow though the service to handle multiple user requests.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||I would be careful which such assumptions. Sure the files can be copied during the usage, but shutting down SQL Server will make the datafile be consistent. If you do not shut down the server service, the information of datafile and logfile can differ making the database after a restore inaccessible. So the better way would be to shutdown the service and therefore close the files.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlexprbol/html/0bd6143a-ca9d-4f36-ae23-bd35a2d22d70.htm

Basically, the application needs to be running first, and then you connect to the user instance with a named pipe protocol. However, the Select statement they use in the example didn't work for me as is;

Select owning_principle_name, instance_pipe_name from sys.dm_os_child_instances

I had to drop the field names and use this

Select * from sys.dm_os_child_instances

Then, from the new connection listed in the object explorer I drilled down to the folder containing the user instance database (the folder name having the same path as my application's database) and was able to "manage objects related to your user instance" as they put it.

Tim

Can multiple apps connect to the same database?

I have an application that was developed under Visual Basic .NET 2005 Standard that I keep continuously running to monitor and gather data and store that data in a SQL Server Express database. This is all done on a single computer that's not networked to anything. The trouble is, I'd like to look at the data in the database from time to time without shutting down the application, but I'm not able to do so. If I try to copy the database files, named lamination.mdf and lamination.ldf, to another location, I get the following error message;

"Cannot copy lamination: There has been a sharing violation. The source or destination file may be in use."

I would like to be able to copy the file to my office computer where it would be convenient to use Management Studio Express to look at the database tables. I can't even use Management Studio Express on the computer where the application is running, as I get the following message when I try to attach the database:

"CREATE FILE encountered operating system error 32(The process cannot access the file because it is being used by another process.) while attempting to open or create the physical file 'C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf'. (Microsoft SQL Server, Error: 5123)"

Here is the connection string in the VB application:

"Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Documents and Settings\tbarnard\My Documents\Visual Studio 2005\Projects\Lamination Phase I\LamDataBase\Lamination.mdf";Integrated Security=True;User Instance=True"

In the VB app, connections to the database are made only every few minutes, and the connections are immediately closed.

Is there anyway I can either copy the database files, or at least look at the database tables with Management Studio Express without stopping the VB application?

Thanks,

Tim

Multiple connections to user instances are not possible. Attach the database to the Express instances to make that possible.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de|||

Jens, I'm confused. You say that multiple connections to user instances are not possible, but then you say to attach the database to the Express intances to make that possible. Is it possible or not? And if it is possible, could you go into more detail to explain how?

Thanks,

Tim

|||You'd need to shut down SQL before you can copy the files.|||I would suggest reading something about the priciples of user instance and regular SQl Server instances. SQL Server instances are permanatly attached to the SQL Server service, while user instances are only attached during the usage of any application. If one application gains access to the file, it is opened exclusivly for the user, therefore cannot be opened through another user instance connection. The Server permanently attached file on the other site will allow though the service to handle multiple user requests.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||I would be careful which such assumptions. Sure the files can be copied during the usage, but shutting down SQL Server will make the datafile be consistent. If you do not shut down the server service, the information of datafile and logfile can differ making the database after a restore inaccessible. So the better way would be to shutdown the service and therefore close the files.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

Jens,

I found one way to connect to, and examine, a database with Sequel Server Management Studio Express, while it is being used by another application with a user instance. It is described at the following link, under the heading "Connecting to a SQL Server Express user instance":

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/sqlexprbol/html/0bd6143a-ca9d-4f36-ae23-bd35a2d22d70.htm

Basically, the application needs to be running first, and then you connect to the user instance with a named pipe protocol. However, the Select statement they use in the example didn't work for me as is;

Select owning_principle_name, instance_pipe_name from sys.dm_os_child_instances

I had to drop the field names and use this

Select * from sys.dm_os_child_instances

Then, from the new connection listed in the object explorer I drilled down to the folder containing the user instance database (the folder name having the same path as my application's database) and was able to "manage objects related to your user instance" as they put it.

Tim

Wednesday, March 7, 2012

Can I use RDO with MDAC 2.8?

Hi,
I have some apps that use RDO and I would like to upgrade MDAC from
2.5 to 2.8. Will the apps continue to work or will I have to make
changes to them?
Thanks,
Marty
Hi
I think this will be fine, but you may want to test thoroughly on one system
first.
John
"Marty" <marty@.australiamail.com> wrote in message
news:29d7efad.0406142058.5d6212b6@.posting.google.c om...
> Hi,
> I have some apps that use RDO and I would like to upgrade MDAC from
> 2.5 to 2.8. Will the apps continue to work or will I have to make
> changes to them?
> Thanks,
> Marty

Can I use RDO with MDAC 2.8?

Hi,
I have some apps that use RDO and I would like to upgrade MDAC from
2.5 to 2.8. Will the apps continue to work or will I have to make
changes to them?
Thanks,
MartyHi
I think this will be fine, but you may want to test thoroughly on one system
first.
John
"Marty" <marty@.australiamail.com> wrote in message
news:29d7efad.0406142058.5d6212b6@.posting.google.com...
> Hi,
> I have some apps that use RDO and I would like to upgrade MDAC from
> 2.5 to 2.8. Will the apps continue to work or will I have to make
> changes to them?
> Thanks,
> Marty

Can I use RDO with MDAC 2.8?

Hi,
I have some apps that use RDO and I would like to upgrade MDAC from
2.5 to 2.8. Will the apps continue to work or will I have to make
changes to them?
Thanks,
MartyHi
I think this will be fine, but you may want to test thoroughly on one system
first.
John
"Marty" <marty@.australiamail.com> wrote in message
news:29d7efad.0406142058.5d6212b6@.posting.google.com...
> Hi,
> I have some apps that use RDO and I would like to upgrade MDAC from
> 2.5 to 2.8. Will the apps continue to work or will I have to make
> changes to them?
> Thanks,
> Marty

Friday, February 10, 2012

Can I install SQL mobile on Storage Card ?

Hi,

SQL mobile apps like - .Net Frame work, SQLCE mobile etc - can they be install on the Storage Card? I am running out of space on my Verizon 6700 and don't have enought memory to install on the device. I cleaned up as much as I could still not enough space on the device.

Can this be done?

Thanks,

P

All my Windows Mobile 5 devices have SQL Compact Edition installed on the storage card. When you execute the installation cab files, you will be asked if you want to put the file on main storage or on the card.|||

Hi,

Are you talking about .NET Frame work, SQLcesa mobile files? There are 4 SQL mobile files that I need to install. Can they all be installed on Storage Card?

Thanks,

P

|||

After looking at my K-Jam's storage card, under the \Windows directory I found the following files:

sqlceca30.dll

sqlcecompact30.dll

sqlceoledb30.dll

sqlceqp30.dll

sqlcese30.dll

Hope this helps.

(I just noticed that this device also has another installation on the main storage. Cleanup!)

|||

Thanks for the help, but I still don't know if this answers my question. As far as I know - I always thought that SQL mobile files were supposed to be installed the device. The DB can reside on Storage Card but the the mobile files.

Anyone else has a comment?

P

|||

Both .NET CF 2.0 SP2 and SQL Compact 3.1 can be installed to a storage card. As Joao mentions, you are simply prompted during install, and given the option to install to either the device or the storage card.

|||After making sure that I only have one installation of SQL Compact Edition 3.1 on my device's storage card (with exactly the same files as I reported previously), I can confirm that the engine does work.