Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2150 connectés 

  FORUM HardWare.fr
  Programmation

  [c sharp.net]

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[c sharp.net]

n°22929
kick
Posté le 06-04-2001 à 13:47:09  profilanswer
 

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

mood
Publicité
Posté le 06-04-2001 à 13:47:09  profilanswer
 

n°22937
juldjin
Posté le 06-04-2001 à 14:06:23  profilanswer
 

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.

n°22945
kick
Posté le 06-04-2001 à 14:24:00  profilanswer
 

putain t vraiment trop con

n°22951
nabab
I'm blogging this.
Posté le 06-04-2001 à 14:28:43  profilanswer
 

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
n°22978
kick
Posté le 06-04-2001 à 15:09:52  profilanswer
 

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

n°22988
nabab
I'm blogging this.
Posté le 06-04-2001 à 15:33:46  profilanswer
 

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

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  [c sharp.net]

 

Sujets relatifs
Plus de sujets relatifs à : [c sharp.net]


Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)