Showing posts with label ado. Show all posts
Showing posts with label ado. Show all posts

Friday, March 23, 2012

Proper ADO Usage where Conflicts will arise

Hi everyone, I'm creating a ASP.NET 2.0 web application utilizing sql server 2000 as a database. My problem revolves around multiuser acces with long running processes. Some of the pages in the application have long running processes against large tables in the database, lets say that take 2minutes to complete. My problem is how do I utilize ado properly in the rest of my application to display a message to users who may try to access data associated with a table while in the midst of one of its long running processes? For instance I would like to notify the user that "Table X is currently locked, please try again in a few minutes".
Do I catch sqlException and examine the .Number property? Any insight is appreciated.

Thanks.

For Sql server 2005 you can use try /catch to Resolve deadlock:Using TRY/CATCH to Resolve Deadlocks in SQL Server 2005

For sql server 2000 you can take a look at:

Tips for Reducing SQL Server Locks

Troubleshooting Deadlocks

Hope it helps.

|||

Sorry I should add that I'm looking for a way to do this WITHOUT stored procedures. My client does not like using stored procedures (regardless of good idea or not), I'm looking for advice on solutions utilizing C# and ADO.NET set of libraries only.

Thanks

sql

Tuesday, March 20, 2012

Programming with OLEDB and ADO.NET

Hi
I currently use OLEDB in my C++ application to connect to MSSQL. I am
considering moving to ADO.NET.
Is there a document outlining the difference between them?
Lawrence
Lawrence,
I have posted a couple of links below one of which is a comparitave overview
of ADO and ADO.net and the other is data retrevial and modification using
ADO.net. OLEDB is still a part of ADO but you now have access to native SQL
in the SQLClient namespace (that is if you are using Sql Server).
Hope this helps.
http://msdn.microsoft.com/library/de...etprogmsdn.asp
http://msdn.microsoft.com/library/de...WithADONET.asp
|||Lawrence,
I found another link with a good article of the evolution of the data access
model. This may give you a better understanding in the change of the model
from OLE DB to ADO.net.
Good Luck.
http://msdn.microsoft.com/library/de...asp?frame=true
|||Thanks for these articles.
They did not really help me. They refer to using OLE DB with a COM interface.
I did not go that direction using C++ but used the API.
Lawrence
"Brian Brown" wrote:

> Lawrence,
> I found another link with a good article of the evolution of the data access
> model. This may give you a better understanding in the change of the model
> from OLE DB to ADO.net.
> Good Luck.
> --
> http://msdn.microsoft.com/library/de...asp?frame=true
>
|||Lawrence,
I am sorry that this information did not help you. Maybe I have
misunderstood what you are wanting to do. Is there something specific that
you are trying to accomplish that you have a question about?

Programming with OLEDB and ADO.NET

Hi
I currently use OLEDB in my C++ application to connect to MSSQL. I am
considering moving to ADO.NET.
Is there a document outlining the difference between them?
LawrenceLawrence,
I have posted a couple of links below one of which is a comparitave overview
of ADO and ADO.net and the other is data retrevial and modification using
ADO.net. OLEDB is still a part of ADO but you now have access to native SQL
in the SQLClient namespace (that is if you are using Sql Server).
Hope this helps.
--
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/adonetprogmsdn.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconAccessingDataWithADONET.asp|||Lawrence,
I found another link with a good article of the evolution of the data access
model. This may give you a better understanding in the change of the model
from OLE DB to ADO.net.
Good Luck.
--
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/sqlserverprog.asp?frame=true|||Thanks for these articles.
They did not really help me. They refer to using OLE DB with a COM interface.
I did not go that direction using C++ but used the API.
Lawrence
"Brian Brown" wrote:
> Lawrence,
> I found another link with a good article of the evolution of the data access
> model. This may give you a better understanding in the change of the model
> from OLE DB to ADO.net.
> Good Luck.
> --
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/sqlserverprog.asp?frame=true
>|||Lawrence,
I am sorry that this information did not help you. Maybe I have
misunderstood what you are wanting to do. Is there something specific that
you are trying to accomplish that you have a question about?

Programming with OLEDB and ADO.NET

Hi
I currently use OLEDB in my C++ application to connect to MSSQL. I am
considering moving to ADO.NET.
Is there a document outlining the difference between them?
LawrenceLawrence,
I have posted a couple of links below one of which is a comparitave overview
of ADO and ADO.net and the other is data retrevial and modification using
ADO.net. OLEDB is still a part of ADO but you now have access to native SQL
in the SQLClient namespace (that is if you are using Sql Server).
Hope this helps.
--
http://msdn.microsoft.com/library/d...netprogmsdn.asp
http://msdn.microsoft.com/library/d...aWithADONET.asp|||Lawrence,
I found another link with a good article of the evolution of the data access
model. This may give you a better understanding in the change of the model
from OLE DB to ADO.net.
Good Luck.
http://msdn.microsoft.com/library/d...asp?frame=true|||Thanks for these articles.
They did not really help me. They refer to using OLE DB with a COM interface
.
I did not go that direction using C++ but used the API.
Lawrence
"Brian Brown" wrote:

> Lawrence,
> I found another link with a good article of the evolution of the data acce
ss
> model. This may give you a better understanding in the change of the mode
l
> from OLE DB to ADO.net.
> Good Luck.
> --
> http://msdn.microsoft.com/library/d...asp?frame=true
>|||Lawrence,
I am sorry that this information did not help you. Maybe I have
misunderstood what you are wanting to do. Is there something specific that
you are trying to accomplish that you have a question about?

Wednesday, March 7, 2012

Programmatically Adding ADO.NET Connections

I can't find any documentation on the connection string for creating ADO.NET connections.

I am displaying a report in a viewer. It is connected to a wrapper DLL through an ADO.NET connection using the properties:
File Path
Class Name
Dataset Names

I'm having trouble accessing these to change them at runtime.

I've tried something like:
rpt.database:Tables(1):ConnectionProperties("File Path") = "c:\..."

No luck. Crystal doesn't have much documentation on this method. Any takers?Nevermind. Got it.

I was able to override the path of my DLL at runtime using the syntax:

report.database.tables(1).ConnectionProperties("File Path").Value = "c:\blah"

seems to be working.

Saturday, February 25, 2012

programm using ado(sql server 2005) do not run in Windows Vista

Hi!

My C++ programm that use ADO to access SQL Server 2005 Express do not work in Windows Vista. Programm code works in Windows XP, but fails in Vista.

_bstr_t strCnn = L"Provider = 'SQLNCLI'; Data Source='\SERVERSQL';Uid=sa;Pwd=devel; ";
ADODB::_CommandPtr _command;
TESTHR(_command.CreateInstance(__uuidof(ADODB::Command)));
_command->PutActiveConnection(strCnn);

Error:

Unhandled exception in test.exe (secur32.dll) 0xC0000005. Access Violation.

Help Me please.

cmd-connection

C:\>OSQL.exe /S USER123-VISTA\\SERVERSQL /U sa /P devel /i c:\\test\1.sql
error

[SQL Native Client]Client unable to establish connection due to prelogin
failure

I'm not sure why you double the backslashes in the command line, and don't double in the connection string.|||

ok , thanks

in command line run

|||

Help

not work in Vista!

My C++ programm that use ADO to access SQL Server 2005 Express do not work in Windows Vista. Programm code works in Windows XP, but fails in Vista.

_bstr_t strCnn = L"Provider = 'SQLNCLI'; Data Source='\SERVERSQL';Uid=sa;Pwd=devel; ";
ADODB::_CommandPtr _command;
TESTHR(_command.CreateInstance(__uuidof(ADODB::Command)));
_command->PutActiveConnection(strCnn);


Error:

Unhandled exception in test.exe (secur32.dll) 0xC0000005. Access Violation.

Help Me please.

The similar problem

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1517814&SiteID=1

I has not understood the decision

programm using ado(sql server 2005) do not run in Windows Vista

Hi!

My C++ programm that use ADO to access SQL Server 2005 Express do not work in Windows Vista. Programm code works in Windows XP, but fails in Vista.

_bstr_t strCnn = L"Provider = 'SQLNCLI'; Data Source='\SERVERSQL';Uid=sa;Pwd=devel; ";
ADODB::_CommandPtr _command;
TESTHR(_command.CreateInstance(__uuidof(ADODB::Command)));
_command->PutActiveConnection(strCnn);

Error:

Unhandled exception in test.exe (secur32.dll) 0xC0000005. Access Violation.

Help Me please.

cmd-connection

C:\>OSQL.exe /S USER123-VISTA\\SERVERSQL /U sa /P devel /i c:\\test\1.sql
error

[SQL Native Client]Client unable to establish connection due to prelogin
failure

I'm not sure why you double the backslashes in the command line, and don't double in the connection string.|||

ok , thanks

in command line run

|||

Help

not work in Vista!

My C++ programm that use ADO to access SQL Server 2005 Express do not work in Windows Vista. Programm code works in Windows XP, but fails in Vista.

_bstr_t strCnn = L"Provider = 'SQLNCLI'; Data Source='\SERVERSQL';Uid=sa;Pwd=devel; ";
ADODB::_CommandPtr _command;
TESTHR(_command.CreateInstance(__uuidof(ADODB::Command)));
_command->PutActiveConnection(strCnn);


Error:

Unhandled exception in test.exe (secur32.dll) 0xC0000005. Access Violation.

Help Me please.

The similar problem

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1517814&SiteID=1

I has not understood the decision