使用工厂方法模式实现多数据库WinForm手机号码查询器
2010-04-08 00:00:00 来源:WEB开发网public class list
{
private int id;
/// <summary>
/// 编号
/// </summary>
public int Id
{
get { return id; }
set { id = value; }
}
private string num;
/// <summary>
/// 号码段(手机号前7位)
/// </summary>
public string Num
{
get { return num; }
set { num = value; }
}
private string code;
/// <summary>
/// 邮政编码
/// </summary>
public string Code
{
get { return code; }
set { code = value; }
}
private string city;
/// <summary>
/// 城市
/// </summary>
public string City
{
get { return city; }
set { city = value; }
}
private string cardtype;
/// <summary>
/// 卡类型
/// </summary>
public string Cardtype
{
get { return cardtype; }
set { cardtype = value; }
}
}
App.config定义选用的DAL及数据库连接信息
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--<add key="DAL" value="CuteMobileSearch.SQLServerDAL"/>
<add key="DAL" value="CuteMobileSearch.SQLiteDAL"/>
<add key="DAL" value="CuteMobileSearch.OleDAL"/>-->
<!--当前使用DAL;可选以上三者之一,分别对应Sql Server、Sqlite、Access数据库-->
<add key="DAL" value="CuteMobileSearch.SQLiteDAL"/>
<add key="SqlConn" value="server=.;database=CuteMobileDB;uid=sa;pwd=123456"/>
<add key="SqliteFile" value="/App_Data/db.db"/>
<add key="OleFile" value="/App_Data/mobile.mdb"/>
</appSettings>
</configuration>
更多精彩
赞助商链接