SHARE
TWEET

Untitled

a guest Jun 18th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SqlCeConnection sqlCE = new SqlCeConnection(@"Data Source=C:DBAvtoBazar.sdf;");
  2.      
  3. SqlCeConnection.Open();
  4.      
  5. string sqlQueryString = "Select NameAvto From Avto"; //для конкретного значения добавь Where
  6. SqlCeCommand comand = new SqlCeCommand(sqlQueryString, sqlCE);
  7. SqlCeDataReader dataReader = comand.executeReader();
  8.  
  9. List<string> avtoNames = new List<string>();
  10. while(dataReader.Read()){
  11.   avtoNames.add(dataReader.getString(0));
  12. }
  13. dataReader.close();
  14.      
  15. using (SqlConnection conn = new SqlConnection(@"Data Source=YOURIP;Initial Catalog=YourCatalog; Integrated Security=no; User id = Name; Password = Pass;"))
  16.             using (SqlCommand command = new SqlCommand("SELECT ID FROM Us where Username='Q'"))
  17.             {
  18.  
  19.                 command.Connection = conn;
  20.                 conn.Open();
  21.                 SqlDataReader reader = command.ExecuteReader();
  22.                 if (reader.Read())
  23.                 {
  24.                     Int32 ret = reader.GetInt32(0);
  25.                     Console.WriteLine(ret.ToString());
  26.                 }
  27.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top