Insert Code Snippet plugin para Windows Live Writer

Testando…

   1: // must add reference to System.Configuration
   2: string connectionString = ConnectionManager.ConnectionStrings["MyConnection"].ConnectionString;
   3: // creating connection
   4: SqlConnection connection = new SqlConnection(connectionString);
   5: // creating a command
   6: SqlCommand command = connection.CreateCommand();
   7: command.CommandText = "SELECT * FROM [MyTable]";
   8: SqlDataAdapter adapter = new SqlDataAdapter(command);
   9:  
  10: // creating DataTable
  11: DataTable dt = new DataTable();
  12: adapter.Fill(dt);
  13:  
  15: foreach (DataRow row in dt.Rows)
  16: {
  17:     Console.WriteLine(row.Field<Guid>(dt.Columns["primary_key"]));
  18: }

Muito Legal!

Sem estilo

   1: // without embed styles
Dentro de um container
   1: // without container
Sem container mas com estilo
   1: line 1
   2: line 2
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>