I have Sybase 12.5.2 Database running in another domain.
I am currently working in a different domain under SQL 2000. I need to call
a stored procedure in Sybase by passing some input parameters and expect
some outptu parameters.
How to call a stored procedure in Sybase 12.5.2 from SQL 2000 Stored
Procedure?
With Regards,
SL AlagappanSQL Server 2000 does not support the execution of remote stored procedures
against a non-SQL Server database.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||First, get a copy of the Sybase ASE drivers. Next, try this:
Place this at the top of your class:
using Sybase.Data.AseClient;
Modify this code appropriately for your server and stored procedure:
// obtain the connection information specified
String host = textBoxHost.Text;
String port = textBoxPort.Text;
String user = textBoxUser.Text;
String pass = textBoxPass.Text;
// build a connect string
AseConnection conn = new AseConnection( "Data Source='" + host +
"';Port='" + port + "';UID='" + user + "';PWD='" + pass +
"';Database='oltp2_db';" );
AseCommand cmd = null;
AseDataReader reader = null;
try
{
conn.Open();
cmd = new AseCommand( "select adi_name from area_of_dominant_influence",
conn );
reader = cmd.ExecuteReader();
listAuthors.BeginUpdate();
while( reader.Read() )
{
listAuthors.Items.Add( reader.GetString( 0 ) );
}
listAuthors.EndUpdate();
}
catch( AseException ex )
{
MessageBox.Show( ex.Message );
}
finally
{
if (reader != null && !reader.IsClosed)
reader.Close();
if (cmd != null)
cmd.Dispose();
if (conn != null && conn.State != ConnectionState.Closed)
conn.Close();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment