本文整理汇总了C#中DataSet1类的典型用法代码示例。如果您正苦于以下问题:C# DataSet1类的具体用法?C# DataSet1怎么用?C# DataSet1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataSet1类属于命名空间,在下文中一共展示了DataSet1类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack && !GridWeb1.IsPostBack)
{
// Create dataset object
this.dataSet11 = new DataSet1();
// Create web worksheet object
WebWorksheet sheet = GridWeb1.WebWorksheets[0];
// Specifies the datasource for the sheet.
sheet.DataSource = dataSet11;
sheet.DataMember = "Products";
// Creates in-sheet column headers.
sheet.EnableCreateBindColumnHeader = true;
// Data cells begin at row 1;
sheet.BindStartRow = 1;
// Creates the data field column automatically.
sheet.CreateAutoGenratedColumns();
// Modifies a column's number type.
sheet.BindColumns["UnitPrice"].NumberType = NumberType.Currency3;
// The "product name" field is required.
Aspose.Cells.GridWeb.Validation v = new Aspose.Cells.GridWeb.Validation();
v.IsRequired = true;
sheet.BindColumns["ProductName"].Validation = v;
// Modifies column headers' background color.
for (int i = 0; i < sheet.BindColumns.Count; i++)
{
sheet.BindColumns[i].ColumnHeaderStyle.BackColor = Color.SkyBlue;
}
// Create demo database object
ExampleDatabase db = new ExampleDatabase();
// Create path to database file
string path = (this.Master as Site).GetDataDir();
// Create connection string
db.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\Miscellaneous\\Database\\demos.mdb";
try
{
// Loads data from database.
db.oleDbDataAdapter1.Fill(dataSet11);
}
finally
{
// Close connection
db.oleDbConnection1.Close();
}
// Binding.
sheet.DataBind();
}
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-.NET,代码行数:60,代码来源:BindDataAtRuntime.aspx.cs
示例2: ToItem
public ListViewItem ToItem(DataSet1.PlaylistRow row)
{
ListViewGroup in_group = null;
string group_name = (row.artist ?? "") + " - " + (row.album ?? "");
foreach (ListViewGroup group in listViewTracks.Groups)
{
if (group.Name == group_name)
{
in_group = group;
break;
}
}
if (in_group == null)
{
in_group = new ListViewGroup(group_name, group_name);
listViewTracks.Groups.Add(in_group);
}
int iconIndex = _icon_mgr.GetIconIndex(new FileInfo(row.path), true);
ListViewItem item = new ListViewItem(row.title, iconIndex);
TimeSpan Length = TimeSpan.FromSeconds(row.length);
string lenStr = string.Format("{0:d}.{1:d2}:{2:d2}:{3:d2}", Length.Days, Length.Hours, Length.Minutes, Length.Seconds).TrimStart('0', ':', '.');
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, lenStr));
item.Group = in_group;
item.Tag = row;
return item;
}
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:26,代码来源:Playlist.cs
示例3: LoadData
public static DataSet1 LoadData(DataSet1 dataSet1)
{
if (dataSet1.Tables.Contains("MainProjects") && dataSet1.Tables.Contains("PartProjects"))
{
DataTable dtMain;
DataTable dtPart;
dtMain = dataSet1.Tables["MainProjects"];
dtPart = dataSet1.Tables["PartProjects"];
dtMain.Rows.Add(1, "TestProject");
var startDate = new DateTime(2016, 01, 18);
var nextDate1 = NextAvailDate(startDate, 6, true);
var endDate1 = EndDate(nextDate1, true);
var nextDate2 = EndDate(endDate1.AddDays(1), false);
var endDate2 = NextAvailDate(nextDate2.AddDays(-1), 5, false);
var nextDate3 = EndDate(endDate2.AddDays(1), true);
var endDate3 = NextAvailDate(nextDate3.AddDays(-1),1, true);
dtPart.Rows.Add(1, 1, "Delmål1", startDate, 6, true, endDate1);
dtPart.Rows.Add(2, 1, "Delmål2", nextDate2, 5, false, endDate2);
dtPart.Rows.Add(3, 1, "Delmål3", nextDate3, 1, true, endDate3);
}
return dataSet1;
}
开发者ID:Qruze,项目名称:Comcare,代码行数:29,代码来源:Loading.cs
示例4: add
/// <summary>
/// 增加
/// </summary>
public void add()
{
System.Text.StringBuilder list = new System.Text.StringBuilder();
DataSet ds = new DataSet1();
ds.ReadXml(Server.MapPath("work.xml"));
DataRow row = ds.Tables[0].NewRow();
row["cname"] = Request.QueryString["cname"];
row["cmoney"] = Request.QueryString["cmoney"];
row["mark"] = Request.QueryString["mark"];
ds.Tables[0].Rows.Add(row);
ds.WriteXml(Server.MapPath("work.xml"));
DataSet dss = new DataSet1();
dss.ReadXml(Server.MapPath("work.xml"));
int ircount = dss.Tables[0].Rows.Count;
int maxid = 0;
for (int i = 0; i < ircount; i++)
{
if (Convert.ToInt32(dss.Tables[0].Rows[i][0]) > maxid)
{
maxid = Convert.ToInt32(dss.Tables[0].Rows[i][0]);
}
}
list.Append("<tr id='d" + maxid + "'>");
list.Append("<td><a href='javascript:del(" + maxid.ToString() + ")'>删除</a></td>");
list.Append("<td>"+Request.QueryString["cname"]+"</td>");
list.Append("<td>" + Request.QueryString["cmoney"] + "</td>");
list.Append("<td>" + Request.QueryString["mark"] + "</td></tr>");
Response.Write(list.ToString());
Response.End();
}
开发者ID:jxb505,项目名称:FbCRM2,代码行数:35,代码来源:addconsell.aspx.cs
示例5: getData
//--------------------------------------------
private DataTable getData()
{
IDictionary<string, List<string>> LoadedImgFiles =
(IDictionary<string, List<string>>)Session["LoadedIamges"];
DataSet1 ds = new DataSet1();
DataTable dt = ds.Tables[0];
for (int i = 0; i < LoadedImgFiles.Count; i ++)
{
DataRow dr = dt.NewRow();
var pair = LoadedImgFiles.ElementAt(i);
//tr.Cells.Add(AddImage(pair.Key.ToString(), pair.Value.ToString()));
//if (i < LoadedImgFiles.Count - 1)
//{
// pair = LoadedImgFiles.ElementAt(i + 1);
// tr.Cells.Add(AddImage(pair.Key.ToString(), pair.Value.ToString()));
//}
dr["FilePath"] = "http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/uploads/" + pair.Key.ToString();
dr["Description"] = dr["FilePath"];
dt.Rows.Add(dr);
}
return dt;
}
开发者ID:pdsoft,项目名称:ImageReport,代码行数:31,代码来源:ReportViewer.aspx.cs
示例6: Frm_ThongKe_Load
private void Frm_ThongKe_Load(object sender, EventArgs e)
{
//1 reset report
this.rpv_BaoCao.Reset();
//2 format report
rpv_BaoCao.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal);
rpv_BaoCao.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
rpv_BaoCao.ZoomPercent = 100;
//config
DataSet1 dataset = new DataSet1();
dataset.BeginInit();
this.rpv_BaoCao.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dataset.Tables["DtHoaDon"]));
this.rpv_BaoCao.LocalReport.ReportPath = "../../rptReportHoaDon.rdlc";
this.rpv_BaoCao.Location = new System.Drawing.Point(0, 0);
dataset.EndInit();
DataSet1TableAdapters.DtHoaDonTableAdapter DTHoaDon = new DataSet1TableAdapters.DtHoaDonTableAdapter();
DTHoaDon.Connection.ConnectionString = HDon_PTA.sChuoiKetNoi();
DTHoaDon.ClearBeforeFill = true;
if (sDk != "")
DTHoaDon.FillBy(dataset.DtHoaDon, sDk);
else
DTHoaDon.Fill(dataset.DtHoaDon);
this.rpv_BaoCao.RefreshReport();
}
开发者ID:MHHHK1,项目名称:Karaoke,代码行数:33,代码来源:Frm_ThongKe.cs
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DataSet1 dsOrder = new DataSet1();
DataTable dtOrder = dsOrder.Tables[0];
dtOrder.Rows.Add("lideng", "125", "M", "1");
dtOrder.Rows.Add("lideng1", "13", "M", "1");
dtOrder.Rows.Add("lideng2", "14", "M", "2");
dtOrder.Rows.Add("lideng3", "15", "M", "2");
DataSetLine dsOrderLine = new DataSetLine();
DataTable dtOrderLine = dsOrderLine.Tables[0];
dtOrderLine.Rows.Add("11", "Desc", "33", "GST1", "1");
dtOrderLine.Rows.Add("11", "Desc", "33", "GST1", "1");
dtOrderLine.Rows.Add("22", "Desc", "44", "GST2", "2");
dtOrderLine.Rows.Add("22", "Desc", "44", "GST2", "2");
ReportDataSource rds = new ReportDataSource("DataSet1", dtOrder);
ReportDataSource reportDataSource = new ReportDataSource("DataSet2", dtOrderLine);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(rds);
ReportViewer1.LocalReport.DataSources.Add(reportDataSource);
ReportViewer1.LocalReport.Refresh();
}
开发者ID:ChegnduJackli,项目名称:Projects,代码行数:26,代码来源:PrintReport.aspx.cs
示例8: Edit
public Edit(DataSet1.recordDataRow row)
{
InitializeComponent();
idLoaded = row.id;
RecordRow = dataSet1.recordData.NewrecordDataRow();
this.relationBox.Text=row.relation;
this.titleText.Text=row.title;
this.fnameText.Text=row.first_name;
this.midnameText.Text=row.mid_name;
this.lnameText.Text=row.last_name;
this.nickText.Text=row.nickname;
if(row.sex == "Male"){male.Checked=true;}
else { female.Checked = true; };
if (row.birthdate != null)
{
this.dateTimePicker1.Checked = true;
this.dateTimePicker1.Value = System.DateTime.Parse(row.birthdate);
}
this.noteText.Text=row.note;
this.pictureBox1.ImageLocation=row.photo;
this.pictureBox1.Image= new Bitmap(row.photo);
this.pictureBox1.SizeMode=PictureBoxSizeMode.StretchImage;
this.pcityText.Text=row.pcity;
this.paddressText.Text=row.paddress;
this.pzipText.Text=row.pzip;
if (((row.scity.Length>0) || (row.sddress.Length>0))
|| ((row.szip.Length > 0) || (row.sstate.Length > 0)))
{
this.checkGroupBox2.Checked = true;
this.groupBox2.Enabled = true;
this.pstateText.Text = row.pstate;
this.scityText.Text = row.scity;
this.saddText.Text = row.sddress;
this.szipText.Text = row.szip;
this.sstateText.Text = row.sstate;
}
this.num1.Text=row.num1;
this.num2.Text=row.num2;
this.num3.Text=row.num3;
this.num4.Text=row.num4;
this.num5.Text=row.num5;
this.num6.Text=row.num6;
this.num1Text.Text=row.nnum1;
this.num2Text.Text=row.nnum2;
this.num3Text.Text=row.nnum3;
this.num4Text.Text=row.nnum4;
this.num5Text.Text=row.nnum5;
this.num6Text.Text=row.nnum6;
this.emailText.Text=row.email;
this.webText.Text=row.web;
this.wpositionText.Text=row.wposition;
this.wcopmanyText.Text=row.wcompany;
this.waddressText.Text=row.waddress;
this.wcityText.Text=row.wcity;
this.wzipText.Text=row.wzip;
this.wtelText.Text=row.wtelephone;
this.wemailText.Text=row.wemail;
this.wwebText.Text = row.wweb;
}
开发者ID:djdominoSVK,项目名称:SchoolStuff,代码行数:59,代码来源:Edit.cs
示例9: showValues
public void showValues()
{
DataSet1 set = new DataSet1();
adapter.Fill(set.DataTable2);
DataRow [] arrRow = set.DataTable2.Select("fname = 'arif'");
DataRow row = arrRow[0];
Console.WriteLine(row[1]);
}
开发者ID:EdiCarlos,项目名称:MyPractices,代码行数:8,代码来源:Myclass.cs
示例10: TZBForm
// Konstruktor
public TZBForm()
{
InitializeComponent();
ds = new DataSet1();
dataGridView1.DataSource = ds.Tables["DataTable1"];
num = ComboBox1.SelectedIndex;
}
开发者ID:777ondro,项目名称:sw-en,代码行数:9,代码来源:TZBForm.cs
示例11: IsWinnerExpected
private bool IsWinnerExpected(int winnerId, DataSet1.playerRow playerA, DataSet1.playerRow playerB)
{
if (playerA.currentPoints >= playerB.currentPoints && winnerId == playerA.Id ||
playerB.currentPoints >= playerA.currentPoints && winnerId == playerB.Id)
return true;
else
return false;
}
开发者ID:joaosantos87,项目名称:TableTennisRanking,代码行数:8,代码来源:Ranking.cs
示例12: LoadDataSource
private void LoadDataSource()
{
//SortBy is required.
if (string.IsNullOrEmpty(dgv1.SortBy)) dgv1.SortBy = DEFAULT_SORT;
DataSet1 ds = new DataSet1();
var dt = Class1.GetData(TABLE_NAME, dgv1.PageSize, dgv1.PageNumber, SEARCH_FIELD, dgv1.SearchEntry, dgv1.SortBy);
dgv1.DataSource = dt;
}
开发者ID:rodchar,项目名称:csgen,代码行数:9,代码来源:Form1.cs
示例13: DeletePlaylist
public DeletePlaylist(Form1 form, DataSet1 dataset, AxWindowsMediaPlayer mp)
{
InitializeComponent();
this.otherForm = form;
this.dataset = dataset;
manager = new PlayListManager(dataset);
this.mp = mp;
}
开发者ID:GentlemanL,项目名称:psychic-octo-computing-machine,代码行数:9,代码来源:DeletePlaylist.cs
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con =new SqlConnection();
con.ConnectionString = "Data Source=LALITHA-PC;Initial Catalog=LSR;Integrated Security=True";
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select customerID,salutation,fname,lname,state_address,email from Customer",con);
DataSet1 dt = new DataSet1();
da.Fill(dt, "Customer");
CrystalReportSource1.ReportDocument.SetDataSource(dt.Tables[0]);
}
开发者ID:LalithaPriyadarshani,项目名称:Hotel-Management-System,代码行数:13,代码来源:Customer.aspx.cs
示例15: frmMain
public frmMain() {
InitializeComponent();
a1 = new ArrayList();
a2 = new ArrayList();
a3 = new ArrayList();
d = new ArrayList();
config = new ArrayList();
ds = new DataSet1();
browserListe = new ArrayList();
bs = new BindingSource();
datasetVersion = "1.0.0";
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:13,代码来源:frmMain.cs
示例16: BindWithInSheetHeaders
private void BindWithInSheetHeaders()
{
// Create dataset object
this.dataSet11 = new DataSet1();
// Create database object
ExampleDatabase db = new ExampleDatabase();
// Create path to database file
string path = (this.Master as Site).GetDataDir();
// Create connection string
db.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\Miscellaneous\\Database\\demos.mdb";
try
{
// Connects to database and fetches data.
db.oleDbDataAdapter1.Fill(dataSet11);
// Create webworksheet object
WebWorksheet sheet = GridWeb1.WebWorksheets[0];
// Clears the sheet.
sheet.Cells.Clear();
// Enables creating in-sheet headers.
sheet.EnableCreateBindColumnHeader = true;
// Data cells begin from row 2.
sheet.BindStartRow = 2;
// Creates some title cells.
sheet.Cells["A1"].PutValue("The Product Table");
sheet.Cells["A1"].GetStyle().Font.Size = new FontUnit("20pt");
sheet.Cells["A1"].GetStyle().HorizontalAlign = HorizontalAlign.Center;
sheet.Cells["A1"].GetStyle().VerticalAlign = VerticalAlign.Middle;
sheet.Cells["A1"].GetStyle().BackColor = Color.SkyBlue;
sheet.Cells["A1"].GetStyle().ForeColor = Color.Blue;
sheet.Cells.Merge(0, 0, 2, 11);
// Freezes the header rows.
sheet.FreezePanes(3, 0, 3, 0);
// Bind the sheet to the dataset.
sheet.DataBind();
}
finally
{
//Close connection
db.oleDbConnection1.Close();
}
}
开发者ID:aspose-cells,项目名称:Aspose.Cells-for-.NET,代码行数:51,代码来源:BindDataUsingWorksheetDesigner.aspx.cs
示例17: botoneraImpCancel1_Click_IMP
private void botoneraImpCancel1_Click_IMP(object sender, EventArgs e)
{
try
{
//*********************IMAGEN PROGRESS BAR**********************
picProgresBar.Visible = true;
botoneraImpCancel1.Visible = false;
//*******************************************************
if (dgvGrilla.DataSource != null)
{
VISTA.DataSet1 dsDatos = new DataSet1();
//CREO EL DATATABLE EN MEMORIA
DataTable tabla = new DataTable();
//FILTRO LOS QUE ESTAN TILDADOS PARA IMPRIMIR
var colIMPRIMIR = (from entity in ListProductoImprimir
where entity.IMPRIMIR == true
select entity).ToList();
foreach (var producto in colIMPRIMIR)
{
DataRow NuevaFila = dsDatos.Tables["ProductosFaltantes"].NewRow();
NuevaFila["Descipcion"] = producto.PRO_DESCRIPCION;
NuevaFila["CodBarra"] = producto.PRO_BARRAS;
NuevaFila["Categoria"] = producto.CATEGORIA_PRODUCTO.CAT_DESCRIPCION;
NuevaFila["Costo"] = "$ " + producto.PRO_COSTO;
NuevaFila["CantidadEnStock"] = producto.PRO_STOCKACTUAL;
NuevaFila["CantidadMinima"] = producto.PRO_STOCKMINIMO;
dsDatos.Tables["ProductosFaltantes"].Rows.Add(NuevaFila);
}
string TipoInfo = "PRODUCTOSFALTANTES";
frmINFORMES form = new frmINFORMES(dsDatos.Tables["ProductosFaltantes"], TipoInfo);
form.Show();
}
//*********************IMAGEN PROGRESS BAR**********************
picProgresBar.Visible = false;
botoneraImpCancel1.Visible = true;
//*******************************************************
}
catch (Exception ex)
{
ProcesarExcepcion(ex);
}
}
开发者ID:maurojuze,项目名称:super-mercado-v2,代码行数:51,代码来源:frmPRODUCTOSFALTANTES.cs
示例18: CreateDataGroupingReport
public XtraReport CreateDataGroupingReport()
{
// Create a report, and bind it to a data source.
XtraReport report = new XtraReport();
DataSet1 ds = new DataSet1();
new DataSet1TableAdapters.OrdersTableAdapter().Fill(ds.Orders);
report.DataSource = ds;
report.DataMember = "Orders";
// Create a detail band and add it to the report.
DetailBand detailBand = new DetailBand();
detailBand.Height = 20;
report.Bands.Add(detailBand);
// Create a group header band and add it to the report.
GroupHeaderBand ghBand = new GroupHeaderBand();
ghBand.Height = 20;
report.Bands.Add(ghBand);
// Create a calculated field, and add it to the report's collection
CalculatedField calcField = new CalculatedField(report.DataSource, report.DataMember);
report.CalculatedFields.Add(calcField);
// Define its name, field type and expression.
// Note that numerous built-in date-time functions are supported.
calcField.Name = "dayOfWeek";
calcField.FieldType = FieldType.None;
calcField.Expression = "GetDayOfWeek([OrderDate])";
// Define the calculated field as
// a grouping criteria for the group header band.
GroupField groupField = new GroupField();
groupField.FieldName = "dayOfWeek";
ghBand.GroupFields.Add(groupField);
// Create two data-bound labels, and add them to
// the corresponding bands.
XRLabel ghLabel = new XRLabel();
ghLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:dddd}");
ghLabel.BackColor = Color.Red;
ghBand.Controls.Add(ghLabel);
XRLabel detailLabel = new XRLabel();
detailLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:MM/dd/yyyy}");
detailLabel.ProcessDuplicates = ValueSuppressType.Suppress;
detailBand.Controls.Add(detailLabel);
return report;
}
开发者ID:cuongpv88,项目名称:work,代码行数:49,代码来源:Form1.cs
示例19: MainWindow
public MainWindow()
{
InitializeComponent();
//http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx
// construct the dataset
DataSet1 dataset = new DataSet1();
// use a table adapter to populate the Customers table
Feuil1_TableAdapter adapter = new Feuil1_TableAdapter();
adapter.Fill(dataset._Feuil1_);
// use the Customer table as the DataContext for this Window
this.DataContext = dataset._Feuil1_.DefaultView;
}
开发者ID:psallandre,项目名称:TestProject_csharp,代码行数:15,代码来源:MainWindow.xaml.cs
示例20: Form_add_user
public Form_add_user()
{
form_opreator = new Form_operator();
user = new DataSet1TableAdapters.UserQuerry1TableAdapter();
dataNew = new DataSet1();
InitializeComponent();
Opacity = 0;
Timer timer = new Timer();
timer.Tick += new EventHandler((sender, e) =>
{
if ((Opacity += 0.08d) == 1) timer.Stop();
});
timer.Interval = 5;
timer.Start();
}
开发者ID:Serious-PO,项目名称:Serious-parking,代码行数:15,代码来源:Form_add_user.cs
注:本文中的DataSet1类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论