In most cases you'll want to create your database and it's schema as part of your applications first deployment. Depending on the scenario, you may create it on the client, or create it on the server, do the initial sync, then stream the file down to the client pre-populated.

Why would you create the database on the fly, rather than ship the initial database with your app?

While you could create the empty shell, and deploy it, you'll almost never want to start with a database that has data? Why? While in development, you'll have some set of data. Months later, when another user first installs your app that data may no longer be valid. Since most sync systems don't track deletes forever, you could wind up with data that is very stale, and now way to effectively update it.

本日志由 flyinweb 于 2012-01-04 11:01:27 发表到 DotNet专栏 中,目前已经被浏览 151 次,评论 0 次;

作者添加了以下标签: SQL Server Compact Edition

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

介绍
现在 ASP.NET 2.0 提供了对成员资格(用户名/密码凭据存储)和角色管理服务的内置支持。由于所有这些服务都是提供程序驱动的(Provider),因此可以方便地用您自己的自定义实现替换。

本日志由 flyinweb 于 2011-07-17 11:40:48 发表到 DotNet专栏 中,目前已经被浏览 793 次,评论 0 次;

作者添加了以下标签: MembershipRoleManager

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

This tutorial we will demonstrate how to access ASP.NET controls located in the LoggedInTemplate of a LoginView Control from the C# code behind class.

本日志由 flyinweb 于 2011-07-15 09:07:37 发表到 DotNet专栏 中,目前已经被浏览 2631 次,评论 2 次;

作者添加了以下标签: LoginViewTemplated Controls

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

 C# code to convert a network in CIDR notation (72.20.10.0/24) to an IP address range

本日志由 flyinweb 于 2011-01-28 11:15:24 发表到 DotNet专栏 中,目前已经被浏览 1541 次,评论 0 次;

作者添加了以下标签: CIDR2IPrangeCIDRtoIPrange

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

最近单位开发一个项目,其中需要用到自动升级功能。因为自动升级是一个比较常用的功能,可能会在很多程序中用到,于是,我就想写一个自动升级的组件,在应用程序中,只需要引用这个自动升级组件,并添加少量代码,即可实现自动升级功能。因为我们的程序中可能包含多个exe或者dll文件,所以要支持多文件的更新。

本日志由 flyinweb 于 2010-11-15 14:59:27 发表到 DotNet专栏 中,目前已经被浏览 4169 次,评论 0 次;

作者添加了以下标签: 自动升级

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

we have checked the posted file of the FileUpload and pass it to the IsImageFile() method that returns a Boolean type for checking the actual type of the posted file. If the file contains image extension such as “jpg”, “gif”, “bmp” and “png” then it will return TRUE else it will return false.

  1. private void StartUpLoad() 
  2.     if (FileUpload1.HasFile) 
  3.     { 
  4.         HttpPostedFile postedFile = FileUpload1.PostedFile; 
  5.         if (IsImageFile(postedFile)) 
  6.         { 
  7.             //Save image here 
  8.         } 
  9.         else 
  10.         { 
  11.             Response.Write("Invalid File, Cannot Upload!"); 
  12.         } 
  13.     } 
  14.     else 
  15.     { 
  16.         Response.Write("Please select a File"); 
  17.     } 
  18.  
  19. protected bool IsImageFile(HttpPostedFile file) 
  20.     bool isImage = false
  21.     System.IO.FileStream fs = new System.IO.FileStream(file.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); 
  22.     System.IO.BinaryReader br = new System.IO.BinaryReader(fs); 
  23.  
  24.     string fileclass = ""
  25.     byte buffer; 
  26.     try 
  27.     { 
  28.         buffer = br.ReadByte(); 
  29.         fileclass = buffer.ToString(); 
  30.         buffer = br.ReadByte(); 
  31.         fileclass += buffer.ToString(); 
  32.     } 
  33.     catch 
  34.     { 
  35.         return false
  36.     } 
  37.     finally 
  38.     { 
  39.         br.Close(); 
  40.         fs.Close(); 
  41.     } 
  42.  
  43.     /*extension lists with codes 
  44.      *7173        gif 
  45.      *255216      jpg 
  46.      *13780       png 
  47.      *6677        bmp 
  48.      *239187      txt,aspx,asp,sql 
  49.      *208207      xls.doc.ppt 
  50.      *6063        xml 
  51.      *6033        htm,html 
  52.      *4742        js 
  53.      *8075        xlsx,zip,pptx,mmap,zip 
  54.      *8297        rar   
  55.      *01          accdb,mdb 
  56.      *7790        exe,dll           
  57.      *64101       bat 
  58.      */ 
  59.  
  60.     //only allow images    jpg       gif     bmp     png      
  61.     String[] fileType = { "255216""7173""6677""13780" }; 
  62.     for (int i = 0; i < fileType.Length; i++) 
  63.     { 
  64.         if (fileclass == fileType[i]) 
  65.         { 
  66.             isImage = true
  67.             break
  68.         } 
  69.     } 
  70.     return isImage; 

 

本日志由 flyinweb 于 2010-11-05 15:18:08 发表到 DotNet专栏 中,目前已经被浏览 3890 次,评论 0 次;

作者添加了以下标签: extension

 .NET 3.5 发布功能强大的新控件(Winform&WebForm) —— Chart

前言

11月25号,Scott在博客上发布了基于.NET Framework 3.5 SP1的图表控件——Chart,可在WinForm和WebForm下使用!并同时提供了大量的示例...

本日志由 flyinweb 于 2010-10-12 16:35:45 发表到 DotNet专栏 中,目前已经被浏览 4809 次,评论 0 次;

作者添加了以下标签: Microsoft Chart ControlsCharMSChart

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文

环境:

本地:Windows 2003+VS2008,IBM CSDK 3.50

远程:Red Hat Enterprise Linux AS release 4 (Nahant Update 5)+Informix Dynamic Server 2000 Version 9.21.UC2

现象:

创建ODBC数据源时,提示

  1. “---------------------------IBM Informix ODBC Error Message:---------------------------Test connection was NOT successful.[Informix][Informix ODBC Driver][Informix]Client host or user (informix@zzy-flyinweb) is not trusted by the server.-----------------------” 

解决办法:

在远程服务器上创建/etc/hosts.equiv 文件,内容如下:

[root@datacenter ~]# cat /etc/hosts.equiv
zzy-flyinweb
59.57.251.62

现象:

报错:System.Data.Odbc.OdbcException: ERROR [42000] [Informix][Informix ODBC Driver][Informix]A syntax error has occurred.

解决办法:

请检查SQL语句是还正确

特别注意:VS2008在自动生成的SQL代码中,会将字段名及表名加[]号括起,而这可能会引起语法错误(不知是不是Informix的原因,去掉相关的中括号即可)

另外,OLEDB方式一直没有通过,原因未知

本日志由 flyinweb 于 2009-06-23 17:21:22 发表到 DotNet专栏 中,目前已经被浏览 5215 次,评论 0 次;

作者添加了以下标签: INFORMIXODBCOLEDB

201/3