Showing posts with label transfer. Show all posts
Showing posts with label transfer. Show all posts

Sunday, March 11, 2012

connecting to AS400

Hi,

I am trying to transfer information from the AS400 to SQL Server tables but I am having problems trying to connect and get information from the AS400. In the data source I select the iseries connection and type in the ip address, username, and password. When I click the test connection button, it connects but under the initial catalog all I get is the computer name. If anyone has any solutions to my problem that would be great

Thnaks

Brian

I have had success connecting to the AS/400 only with an ADO Data Reader (could not use an OLE DB Source) using the IBMDA400 Provider (connections string included below). You must also explicitly specify libraries in your select statements, and not rely on library list.

Sample connection string:
Data Source=server;User ID=uid;Provider=IBMDA400.DataSource.1;Persist Security Info=False;Connect Timeout=300;Catalog Library List=library1, library2;

|||Jeaux - the connection string you specify works fine for me but it seems to defeat the purpose of the library list to some degree. Do you have any idea how to allow allow SQL to determine where the object is found in the library list and utilize it?

Thursday, March 8, 2012

Connecting to an external server

Hi,
I have been developing an app using SQL Server 2000 and am ready to transfer to a server located offsite. How can I connect to this server through enterprise manager or anything else so that I can use the copydatabase wizard to move it to the live server?
Thanks
WheelzPerhaps I'm missing something here (wouldn't be the first time, I'll grant ya that ;) ) but if it's on your server network, you just add the server to your "SQL Server Group" in the enterprise manager, and then you can transfer stuff willy-nilly.

Right-click on the SQL Server Group in the console file system pane of the Enterprise Manager, then add the remote server.

Like I said, I may be missing something, but if the remote server is accessable from your network, you oughta be good to go, I would think. :?:|||Hi,
I've done what you said and it offers me to register a new instance or a new group. Either one of these doesn't let me specify an IP address to the live server.|||You should regiustering a server alias..

And that has to be added....to....Damn a network question...

I forget...

But it's good to do this in case you have to flip th ip for disaster purposes...

I'll go look...|||Check this out

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=36034&SearchTerms=server,alias,

Tuesday, February 14, 2012

Connect to the DB?

Hi,

I am a beginner in asp.net so sorry for my question ..

I want to make the event for the button when clicked , inside this event I will be transfer the value of dropdownlist into the DB by use ( WHERE ) condition ..

My question is :

- how I write the connection to the DB ?? is this a connection statement in the web.config ?? or what ?? because it generate an error by this code..

SqlConnection sqlConnection1 =new System.Data.SqlClient.SqlConnection("Data Source=-\SQLEXPRESS;Initial Catalog=2C2Mdb;Integrated Security=True");

SqlCommand cmd =newSqlCommand();

cmd.CommandType = System.Data.CommandType.Text;cmd.CommandText ="INSERT Meeting (mSessionNO) VALUES (" + DropDownList2.selectedvalue +") WHERE [HijriYear]=" + DropDownList1.SelectedValue ;

cmd.Connection = sqlConnection1;

sqlConnection1.Open();

cmd.ExecuteNonQuery ();

sqlConnection1.Close();

What is the proplem ?

There are a few things with the code

Add the @. symbol in front of the string so that it escapes the escape characters. \ is an escape character in C#

SqlConnection sqlConnection1 =new System.Data.SqlClient.SqlConnection(@."Data Source=-\SQLEXPRESS;Initial Catalog=2C2Mdb;Integrated Security=True");

You need to put quotes around your dropdownlist values

cmd.CommandType = System.Data.CommandType.Text;cmd.CommandText ="INSERT Meeting (mSessionNO) VALUES (' " + DropDownList2.selectedvalue +"') WHERE [HijriYear]='" + DropDownList1.SelectedValue +" ' ";

|||

Hi Sofy,

Everything seems correct except your ConnectionString.

Try this

SqlConnection sqlConnection1 =new System.Data.SqlClient.SqlConnection("Data Source=(local)\SQLEXPRESS;Initial Catalog=2C2Mdb;Integrated Security=True");

Let me know if it works

Regards

|||

Thaaaanks for all replies ...