Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Friday, March 30, 2012

Release database lock

Actually I'd like to know how I got the lock and then you can tell me how to release it. Here's the problem (this is sql server 2000 with visual studio 2005)

I have a windows service that wakes up every 5 minutes and does some database work (reads rows from a table, process them, inserts them into another table). When the inserts are complete, the process should (I would think) release the database lock, but it doesn't. The database is accessed via a dataset object and that object is disposed of via the using/end using statement. Is there something I have to put in the connection string to avoid this behavior?

Thanks,

Bob

If a connection is open from the client it will maintain an S lock on the database. This is true even if the client is doing no work. The purpose of the lock is to prevent certain operations that might change the state of the database (like say dropping it) while there are connections relying on the current state.

Is this causing you some problem?

|||I just don't understand how the connection could possibly still be open. I would assume that by using VS 2005's generated dataset code, that disposing of a dataset object would close the connection. I certainly don't want the connection open while the process sleeps for 5 minutes (or more) at a time.|||

If you are using SqlClient (and it sounds like you are) it could very well be taking advantage of connection pooling.

You can tell for certain by using profiler to monitor the Audit Login/logout events.

|||

Well this statement is no doubt in the code:

imports System.Data.SqlClient

Is that what you mean? If so, can I close the connection manually?

|||

I figured it out shortly after my last post. I added this to my connection string:

pooling=false;timeout=45;

seems to work just fine.

Relative ConnectionString for SQL Server 2005 Express

I am creating a application in Visual C++ 2005 that has database connections in it. I have gone through the process of setting up the data source and it will work great on my computer. However, the second I move either the project or the created executable to another computer the application keeps crashing. I know that it is crashing due to the database connection string. The string is setup to work only on my computer, I am wondering how do I make, or edit, the string to work on any computer? Thanks for the help.
Have you gone into SQL Server Surface Area Configuration to enable remote connections to the database?

Monday, March 26, 2012

Relational database

Hi

I'm using VB.NET,ADO.NET in ASP.NET .

Microsoft .Net framework 1.0

Windows 2000

Visual Studio IDE

and SQLServer.

I have to create to tables as

Table1 contains ID,Name

Table2 contains ID,Marks,Foreign Key ie Primary key of the table Table1.

Give me an information how to create these two tables in SQLServer (I know how to create a table but i don't know how to create a table which includes Foreign Key.)

Then using Dataset i want to display the records as Name,Marks which are stored in two tables.

I have studied that in ADO Join query and record set object is used but it gives a problems and it is not good when we want to transfer the data between two applications or pages but dataset solves all those problems.

Give me an information about it.

Kindly help me

Thanks in advance

Regards.

To create table with Foreign key constraint using T-SQL:

create table tbl_PK (ID int primary key,name varchar(30))
go
create table tbl_FK (ID int foreign key REFERENCES tbl_PK(ID),
Marks varchar(50))

To get the joined result:


select p.name,f.marks from tbl_PK p join tbl_FK f
on p.ID=f.ID

|||

Hi

What you have given is also a join query.but i have studied that no need of join query in case of dataset but it is required for record set.

Thanks

|||To do that, please take a look a the following short movie:

http://msdn.microsoft.com/vstudio/express/media/en/AbsoluteBeginner/vb/08VB.wvx

This is tutorial movie about VWD 2005 and SQL server EE, I believe you can also apply it to VS 2005 because the similarity.

Basically what you do is you create database diagram with right clickon 'Database Diagram' under the Database explorer of your databasefilename. Then add new diagram. After that you can add all your tables,then drag the primary key to create the foreign key.

hope this will help.

Wednesday, March 21, 2012

Reinstall RS Client?

Hi,
I have purchased a new copy of SQL Server for running Reporting Service as
the Evaluation copy has expired.
I have installed Visual Studio with RS client on a workstation as I don't
want to install Report Designer on the Server.
I would like to know is it necessary for me to uninstall the Evaluation Copy
RS Client on my workstation before installing the new RS Client ?
Your advice is sought.I am pretty sure the evaluation expiration is only the server part of RS,
not the design tools. Are you getting a message saying that it has expired
when you try to design? You should still be able to design and preview. If
that is the case (I am trying to remember what I did but I don't think I did
anything with the client tools). Unless you have a problem my suggestion is
to leave the designer alone. After installing the new server you should
download SP2 and install that at both the server and the client.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:%239RZUnfsFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I have purchased a new copy of SQL Server for running Reporting Service as
> the Evaluation copy has expired.
> I have installed Visual Studio with RS client on a workstation as I don't
> want to install Report Designer on the Server.
> I would like to know is it necessary for me to uninstall the Evaluation
> Copy RS Client on my workstation before installing the new RS Client ?
> Your advice is sought.
>

Monday, February 20, 2012

Registering a SQL Server Instance

Ok, well I just installed Visual Studio.NET 2003 on my PC, and toprepare for next years courses I thought I might get going on some ofthe exercises. But I am rather new to this and when I try to expand"SQL Server" in the "Server Explorer Window" I get this message.
Could not automaticly discover any SQL Server instances.
Choose Register SQL Server instance from the shortcut menu if you know there are SQL Server instances on this machine.

From there all I know is that I can right click on "SQL Server" andchose register new instance, but I do not know what to enter, and itsuggrests leaving it balck but that doesn't work. I will get aninstance but when I try to expand it another error pops up.
So as you can see I have no idea what I am doing when it comes to SQL Server, can any one help me with this?
Thanks again,
MCCCStudentTry either (local) WITH the parentheses, or the name of your computer.
|||I have tried the name of my computer and then i just tried (local), andlocal, and then when I try an expand it, it brings up the "SQL ServerLogin Window" with Administrator in the login name so i typed in myadmin password and this error poped up
[DBNETLIB][ConnectionOpen(Connect()).]SQL Server does not exist or access denied.
|||Is the SQL Server service running?
|||If you right-click on the Server Group instance in Enterprise Manager,select 'properties' then click on the Connection tab, what method ofAuthentication is selected?
Tryst
|||Thanks guys my problems are solved