1、用什么好,是自己写类直接执行好呢,还是用vs2008带的DataSet好呢?
2、增、删、改、查,包括分页,哪位能提供一个例子?本人新用asp.net不久的,请大家多多指教!送上 100分,以表谢意。
2、增、删、改、查,包括分页,哪位能提供一个例子?本人新用asp.net不久的,请大家多多指教!送上 100分,以表谢意。
解决方案 »
- WPF Grid.ChildRen高手出没
- C#和Access的应用求教
- 见过的无比奇怪的问题 求解释 AxDSOFramer控件中嵌入的excel 另存为后居然……
- UpdateCommand 影响了预期 1 条记录中的 0 条 情况如何处理
- c#中的DataGridView更新问题,急等!
- TcpClient.ReceiveBufferSize 属性默认是 8192 ,如果返回的流数据大于这个值,是不是我就不能收到完整的数据,必须将ReceiveBufferSize数
- 请教高手(求用C#编写调用MD5算法的例子在线等!)
- 求问字符转换问题
- [Description("Overloaded binary+operator")]应该用什么命名空间?
- process的输入流问题,困惑中
- 如何做投影图,(只有五十分了)
- 遍历FormView中的所有textbox并取值的问题。
using system;
using system.data.oledb;
public class oledbtest{
public static void main()
{
//创建数据库连接
oledbconnection aconnection = new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=c:\\db1.mdb");
//创建command对象并保存sql查询语句
oledbcommand acommand = new oledbcommand("select * from emp_test", aconnection);
try
{
aconnection.open();
//创建datareader 对象
oledbdatareader areader = acommand.executereader();
console.writeline("this is the returned data from emp_test table");
//循环遍历数据库
while(areader.read())
{
console.writeline(areader.getint32(0).tostring());
}
//关闭reader
areader.close();
//关闭连接
aconnection.close();
}
//异常处理
catch(oledbexception e)
{
console.writeline("error: {0}", e.errors[0].message);
}
}
}