老兄,自已搜索一下吧,今天CSDN很快的,哎,这问题已经问烂了
解决方案 »
- 初学C#正则表达式,有问题请教各位大神……
- js 下拉列表框如何根据指定值找到列表中对应值得索引
- 各位大哥大姐们,我是初学.net,想找其他方面的比较好用的控件!
- 外接程序编写,如何编写多个子菜单?见内容
- 如何实现全选功能(按纽在模板列中)和如何实现模板列事件的疑问。
- 一字段为是/否。在c#中怎么select选出这字段为是的内容??????????、
- 用DesignSurface制作设计器
- progressBar如何根据当前进程来显示进度条?在线等
- 在vs.net 2003怎么设置textbox显示为密码
- 求一正则表达式,或者截取函数,匹配<?xml.*</EMC>中内容,文档中可能有多个块,还有不正常的格式
- lkal4587 (影子武士 LuxuRy Lab) 你的源码还能再公开一次吗?
- C#WEB开发问题,如何引用别的C#文件的内容
string SqlStr="select * from Customers";
myConnection.Open();
SqlCommand mySqlCom=new SqlCommand(SqlStr,myConnection);
SqlDataAdapter myDataAd=new SqlDataAdapter();
myDataAd.SelectCommand=mySqlCom;
DataSet myData=new DataSet();
myDataAd.Fill(myData,"Customers");
dataGrid1.DataSource=myData.Tables["Customers"].DefaultView;
<%@ Import Namespace="System.Data.SqlClient" %><html>
<script language="C#" runat="server"> protected void Page_Load(Object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("server=(local)\\NetSDK;database=pubs;Trusted_Connection=yes");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from Authors", myConnection); DataSet ds = new DataSet();
myCommand.Fill(ds, "作者"); MyDataGrid.DataSource=ds.Tables["作者"].DefaultView;
MyDataGrid.DataBind();
}</script><body> <h3><font face="宋体">DataGrid 控件的简单选择</font></h3> <ASP:DataGrid id="MyDataGrid" runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="宋体"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false"
/></body>
</html>
Provider="Microsoft.Jet.OLEDB.4.0;";
DataBase=Server.MapPath("mesh.mdb");
ConnStr="Provider="+Provider+"Data Source="+DataBase;
OleDbDataAdapter Cmd3;
Cmd3=new OleDbDataAdapter("Select * from
Customers ",ConnStr);
DataSet ds=new DataSet();
Cmd3.Fill(ds,"Customers");
DataGrid1.DataSource=ds.Tables["Customers"].DefaultView;
DataGrid1.DataBind();mesh.mdb为数据库,包含Customers表.