C#中使用DataTable显示Access数据库中文件列表
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
this.comboBox2.Items.Clear();
switch(this.comboBox1.SelectedIndex)
{
case 0:
try
{
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;User ID=admin;Data Source=C:\tmpAccess\DataBase1.mdb");
conn.Open();
if(conn.State == System.Data.ConnectionState.Open){
Console.WriteLine("Success");
}
DataTable test = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new Object[] { null, null, null, "Table" });
this.dataGridView1.DataSource =test;
int tableIndex = test.Columns.IndexOf("TABLE_NAME");
foreach (DataRow row in test.Rows)
comboBox2.Items.Add(row[tableIndex].ToString());
&nb
相关文档:
说明:准备出一个系列,所谓精髓讲C#语言要点。这个系列没有先后顺序,不过尽量做到精。可能会不断增删整理,本系列最原始出处是csdn博客,谢谢关注。
C#精髓
第四讲 GridView 72般绝技
作者:清清月儿
主页:http://blog.csdn.net/21aspnet/ 时间:2007. ......
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MySql ......
1,在web服务器上安装Oracle数据库客户端,这是连接Oracle数据库的基础(但,不一定是必须的)。
2,在客户端的Net Manager 中进行配置服务的名称,配置如图(这一点非常的重要以后的链接全都在这个服务名称的基础上进行的)
3,ASP链接服务的链接字符串和方法如下:
<%
connstr= "Provider=MSDAORA.1;Password=***; ......
/// <summary>
/// 方法一:通过使用 new 运算符创建对象
/// </summary>
/// <param name="strSource">需要加密的明文</param>
/// <returns>返回16位加密结果,该结果取32位加密结果的第9位到25位</returns>
public string Get_MD5_Method1(strin ......