Bonjour, tout le monde
Je veux faire un code qui me permet d'accéder a ma base de données , et ajouter une table voici mon code
Ce code ne marche pas est ce quelqu'un peut m'aider
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 SqlConnection connection = new SqlConnection("Data Source=MonServeur;Initial Catalog=BaseDeDonnees;Integrated Security=SSPI;"); connection.ConnectionString = "Data Source= MonServeur;Initial Catalog= BaseDeDonnees;Integrated Security=SSPI;"; using (connection) { SqlCommand command1 = new SqlCommand( "create table table1(id integer PRIMARY KEY NOT NULL IDENTITY,login varchar (255) not null,MotDePasse varchar (255) not null);", connection); connection.Open(); SqlDataAdapter dataAdapter = command1.EndExecuteNonQuery;
Merci d'avance
Partager