Re: Connection trough MarshalByRefObject
- From: "Norman Yuan" <NotReal@xxxxxxxxxxx>
- Date: Thu, 14 Dec 2006 07:30:35 -0700
RecordSet? Do you use ADO (the old COM object)? Why?
OK, if you insist using ADO, rather than ADO.NET for your special reason,
that is fine. However, you cannot use ADO.NET's SqlConnection object for
opening ADODB.RecordSet. You need a ADODB.Connection.
"Krys" <it@xxxxxxx> wrote in message
news:op.tkivvxoakno4s0@xxxxxxxxxxxxxxxxxxx
When i invoke a method (which tries to create a database query) from
client on server, server throws COMException.
this code is in dll used by server and client:
public class zdalne_objekty : MarshalByRefObject
{
public string testowa()
{
Recordset wynik = new Recordset();
SqlConnection conn = new SqlConnection("User ID=sa;Initial
Catalog=test;Data Source=KRYSW\\INSERTGT;Packet Size=4096;Workstation
ID=KRYSW");
wynik.Open("SELECT * FROM tabelka", conn,
ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockUnspecified,8);
return "test";
}
code from client:
TcpChannel c = new TcpChannel();
ChannelServices.RegisterChannel(c, true);
object zdalny_objekt =
Activator.GetObject(typeof(zdalne_objekty), "tcp://localhost:10500/Objekt
zdalny.tcp");
zdalne_objekty zdal = (zdalne_objekty)zdalny_objekt;
string ds = zdal.testowa();
when i use method testowa() local on serwer, everything works fine.
what is wrong? why doesnt it work from client trough network?
.
- Follow-Ups:
- Re: Connection trough MarshalByRefObject
- From: Krys
- Re: Connection trough MarshalByRefObject
- References:
- Connection trough MarshalByRefObject
- From: Krys
- Connection trough MarshalByRefObject
- Prev by Date: Re: Known Issues w/ File.AppendText()
- Next by Date: Re: Create a budget
- Previous by thread: Connection trough MarshalByRefObject
- Next by thread: Re: Connection trough MarshalByRefObject
- Index(es):
Relevant Pages
|