protected dsReports m_ds = new dsReports();
dsReports.f_mar_analysisDataTable dtAnalysis = m_ds.f_mar_analysis;dsReports.f_mar_analysis_datesDataTable dtDate = m_ds.f_mar_analysis_dates;
dataAdapObj.Fill(dtAnalysis);//Note that, you can also add data to your datatable row by row like in the following example.dsReports.f_mar_analysis_datesRow dateRow = datesDt.Newf_mar_analysis_datesRow();dateRow.a_dep_date = depDate;dateRow.a_total_revenue = 0;datesDt.Rows.Add(dateRow);datesDt.AcceptChanges();//However, as far as I know there is no way to cast a regular datatable into a datatable of typed dataset. The most you will get isnull.As you see from the above examples, typed datasets provide 1. Intelli-sense for a. datatables b. dataColumns c. dataColumnNames //not mentioned above So no need to memorize any table name or column names.2. Datatype check during compile time, not during run-time. As a result, it will pre-check possible errors (type and casting errors) that may arise long before you receive the complains from customers.Last post by [Sevket Seyalioglu] on Aug 11, 2004.
[C#]publicvoid RunSqlTransaction(string myConnString) { SqlConnection myConnection = new SqlConnection(myConnString); myConnection.Open(); SqlCommand myCommand = myConnection.CreateCommand(); SqlTransaction myTrans; // Start a local transaction myTrans = myConnection.BeginTransaction("SampleTransaction"); // Must assign both transaction object and connection // to Command object for a pending local transaction myCommand.Connection = myConnection; myCommand.Transaction = myTrans; try { myCommand.CommandText = "Insert into Region (RegionID, " + "RegionDescription) VALUES (100, ’Description’)"; myCommand.ExecuteNonQuery(); myCommand.CommandText = "Insert into Region (RegionID, " + "RegionDescription) VALUES (101, ’Description’)"; myCommand.ExecuteNonQuery(); myTrans.Commit(); Console.WriteLine("Both records are written to database."); }catch(Exception e) { try { myTrans.Rollback("SampleTransaction"); }catch (SqlException ex) { if (myTrans.Connection != null) { Console.WriteLine("An exception of type " + ex.GetType() + + " was encountered while attempting to " + "roll back the transaction."); } } Console.WriteLine("An exception of type " + e.GetType() + " was encountered while inserting the data."); Console.WriteLine("Neither record was written to database."); }finally { myConnection.Close(); } } Last post by [Sevket Seyalioglu] on Aug 3, 2004.
TableRow tr = new TableRow();TableCell tc = new TableCell(); tc.Text = "SOME TEXT"; tc.Style.Add("writing-mode","tb-rl"); tc.Style.Add("filter","flipv fliph"); tc.Wrap = false; tr.Cells.Add(tc);