本文整理汇总了C#中DataAccess.ReadDataFromTable方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.ReadDataFromTable方法的具体用法?C# DataAccess.ReadDataFromTable怎么用?C# DataAccess.ReadDataFromTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.ReadDataFromTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
DataAccess da = new DataAccess(ConfigurationManager.ConnectionStrings["EMIMSConnectionString"].ConnectionString);
SqlDataReader myReader = da.ReadDataFromTable("[5min]");
Chart1.DataBindCrossTable(myReader, "传感器编号", "小时", "数据值", null);
myReader.Close();
// Set series appearance
MarkerStyle marker = MarkerStyle.None;
foreach (Series ser in Chart1.Series)
{
ser.ShadowOffset = 2;
ser.BorderWidth = 3;
ser.ChartType = SeriesChartType.Line;
ser.MarkerSize = 12;
ser.MarkerStyle = marker;
ser.MarkerBorderColor = Color.FromArgb(64, 64, 64);
ser.Font = new Font("Trebuchet MS", 8, FontStyle.Bold);
marker++;
}
}
示例2: Update
public void Update()
{
string SenID= Page.Request.QueryString["senID"];
Sensor_Option option = (Sensor_Option)this.Parent.FindControl("Sensor_Option1"); // this.Parent.FindControl(Sensor_Option)
DataAccess da = new DataAccess(ConfigurationManager.ConnectionStrings["EMIMSConnectionString"].ConnectionString);
SqlDataReader myReader = da.ReadDataFromTable("[EMIMS].[dbo].[监测信息视图]", option.GetAcc(), option.GetDatePeriod(), SenID);
string xvalue = option.GetAcc().Replace("[","").Replace("]","");
Chart1.DataBindCrossTable(myReader, "传感器编号",xvalue , "数值", null);
myReader.Close();
if (Chart1.Series.Count>1)
{
double[] range = findRange(Chart1.Series[1].Points);
Chart1.ChartAreas[0].AxisX.Minimum = range[0];
Chart1.ChartAreas[0].AxisX.Interval = 1;
Chart1.ChartAreas[0].AxisY.Minimum = (int)(range[2] - 5);
Chart1.ChartAreas[0].AxisY.Maximum = (int)(range[3] + 5);
}
// Set series appearance
//Chart1.BackColor = Color.Transparent;
//MarkerStyle marker = MarkerStyle.None;
//foreach (Series ser in Chart1.Series)
//{
// ser.ShadowOffset = 2;
// ser.BorderWidth = 1;
//ser.ChartType = SeriesChartType.Line;
// ser.MarkerSize = 12;
// ser.MarkerStyle = marker;
// ser.MarkerBorderColor = Color.FromArgb(64, 64, 64);
// ser.Font = new Font("Trebuchet MS", 8, FontStyle.Bold);
// marker++;
//}
}