易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

access 中的文本到数据类型的转换

用Cdbl()试试
CDbl(str)   -->   双精度
CInt(str)   -->   整型
CLng(str)   -->   长整型
CSng(str)   -->   单精度
CDate(str)   -->   日期型 ......

c#短信网关中关于短信内容编码的转换

无论在cmpp或sgip中,都会遇到短信编码格式转换的问题。
因为现在短信编码常用的格式有三种:0:ASCII串,8:UCS2编码,15:含GB汉字。在发送或接收短信时,都会用到相应的编码转换。如以下代码:
public static String Decode(Byte[] buf, int StartIndex, int Length, CODING Coding)
{
......

MD5加密的一般方法(ASP.NET / C#2005)

  /// <summary>
/// 方法一:通过使用 new 运算符创建对象
/// </summary>
/// <param name="strSource">需要加密的明文</param>
/// <returns>返回16位加密结果,该结果取32位加密结果的第9位到25位</returns>
public string Get_MD5_Method1(strin ......

C#.NET防止SQL注入式攻击

1  防止sql注入式攻击(可用于UI层控制) #region  防止sql注入式攻击(可用于UI层控制)
  2 
  3   /**/ /// 
  4  ///  判断字符串中是否有SQL攻击代码
  5  /// 
  6  ///  传入用户提交数据
  7  ///  ......

C#中对XML节点进行增删改查

号称xmlhelper的一个类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XML文档操作管理器
/// </summary>
public class XMLHelper
{
public X ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号