dbTalk Databases Forums  

connecting from c#

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss connecting from c# in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ivan
 
Posts: n/a

Default connecting from c# - 06-15-2010 , 08:34 AM






Hello,

I'm new to sqlanywhere, so my question might be strange.
it is not really clear for me how can I connect from c# code.

I created a database with encryption option. it has only one table,
(also encrypted).
I can start this server with Personal server, or sybase central.
in this case the connection string is the following.
conn.ConnectionString =
string.Format("ENG=sp;DBN=sp;UID=DBA;PWD={0}", pwd);
this is working fine.

but if the server is still not started is it possible to connect
directly from .net to that database?
conn.ConnectionString =
string.Format("ENG=sp;DBN=full_path_of_database_fi le;DBKEY=encryption_key;UID=DBA;PWD={1}",
pwd);

the samples are all using odbc. is it the only way to automatically
start a database?

thanks
Ivan

Reply With Quote
  #2  
Old   
Ivan
 
Posts: n/a

Default Re: connecting from c# - 06-15-2010 , 09:57 AM






sorry, I found the problem
DBN is the database name
DBF is the path of the database file.

Ivan

On Jun 15, 2:34*pm, Ivan <pilles... (AT) gmail (DOT) com> wrote:
Quote:
Hello,

I'm new to sqlanywhere, so my question might be strange.
it is not really clear for me how can I connect from c# code.

I created a database with encryption option. it has only one table,
(also encrypted).
I can start this server with Personal server, or sybase central.
in this case the connection string is the following.
* * * conn.ConnectionString =
string.Format("ENG=sp;DBN=sp;UID=DBA;PWD={0}", *pwd);
this is working fine.

but if the server is still not started is it possible to connect
directly from .net to that database?
* * * conn.ConnectionString =
string.Format("ENG=sp;DBN=full_path_of_database_fi le;DBKEY=encryption_key;UID=DBA;PWD={1}",
pwd);

the samples are all using odbc. is it the only way to automatically
start a database?

thanks
Ivan

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.