[c sharp.net]

[c sharp.net] - Programmation

Marsh Posté le 06-04-2001 à 13:47:09    

es-ce que qqlun à un exemple pour acceder à une base sql2000 avec c sharp ou vb.net

Reply

Marsh Posté le 06-04-2001 à 13:47:09   

Reply

Marsh Posté le 06-04-2001 à 14:06:23    

bonjour monsieur que je ne connais pas
 
pour acceder en mode virtuel sur un coupleur sql2000 alias VB script, c'est simple tu relis la contorsion int 10h en amont de ton progiciel, tout bete.

Reply

Marsh Posté le 06-04-2001 à 14:24:00    

putain t vraiment trop con

Reply

Marsh Posté le 06-04-2001 à 14:28:43    

Il n'y a presque rien à faire, si tu as Visual Studio.NET, tu as egalement MSDN.NET ... il y a plusieurs exemple que j'ai d'ailleurs deja donné sur ce forum il suffit peut etre d'une simple recherche sinon ben je remettrai l'exemple mais va falloir ouvrir MSDN ....


---------------
Ce qui vaut la peine d'être fait vaut la peine d'être bien fait
Reply

Marsh Posté le 06-04-2001 à 15:09:52    

desole, j'ai pas trouve tes anciennes reponse sur le sujet, est-ce tu peut la reposter

Reply

Marsh Posté le 06-04-2001 à 15:33:46    

public void SelectSQLSrvRows(string myConnection,string mySelectQuery) {
   // If the connection string is null, use a default.
   if(myConnection == "" ) {
      myConnection = "Persist Security Info = False;" +  
      "Initial Catalog = Northwind;Data Source = myDataServer;User ID = myName;" +
      "password=* DCiDKnee;";
   }
   SQLConnection mySQLSrvConn = new SQLConnection(myConnection);
   SQLCommand mySQLCommand = new SQLCommand(mySelectQuery);
   mySQLSrvConn.Open();
   mySQLCommand.ActiveConnection = mySQLSrvConn;
   mySQLCommand.ActiveConnection.Close();
}
 
 
public void ReadMyData(string myConnString) {
   string mySelectQuery = "SELECT OrderID, Customer FROM Orders";
   SQLConnection myConnection = new SQLConnection(myConnString);
   SQLCommand myCommand = new SQLCommand(mySelectQuery,myConnection);
   myConnection.Open();
   SQLDataReader myDataReader;
   myCommand.Execute(out myDataReader);
   // Always call Read before accessing data.
   while (myDataReader.Read()) {
      Console.WriteLine(myDataReader.GetInt32(0) + ", " + myDataReader.GetString(1));
   }    
   // always call Close when done reading.
   myDataReader.Close();
   // Close the connection when done with it.
   myConnection.Close();
}


---------------
Ce qui vaut la peine d'être fait vaut la peine d'être bien fait
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed