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

 


Dernière réponse
Sujet : [c sharp.net]
nabab 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();
}

Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
nabab 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();
}
kick desole, j'ai pas trouve tes anciennes reponse sur le sujet, est-ce tu peut la reposter
nabab 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 ....
kick putain t vraiment trop con
juldjin 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.
kick es-ce que qqlun à un exemple pour acceder à une base sql2000 avec c sharp ou vb.net

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