C#及VB.NET語法轉換

透過以下工具您可以將C#及VB.NET語法轉換
C# to VB.NEThttp://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
VB.NET to C#http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx

如何使用程式匯入OFFICE2007 Excel或Access檔案

Office 2007不支援
provider=Microsoft.Jet.OleDb.4.0 開啟

需使用下列的connection

Access 2007
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;

Excel 2007
provider=Microsoft.ACE.OleDb.12.0; Data Source=C:\excel\2007.xlsx;Extended Properties='Excel 12.0;HDR=Yes;IMEX=2;'";

如何取得Excel中的Sheet Name

在做EXCEL匯入時,常因Sheet Name 使用者會自行更名,造成在程式編寫時會出現檔案名稱不存在的問題,如果限定使用者固定只能使用單一的Sheet Name又不是很人性化。
所以在網路上找了一下解決方法
解法如下

以 C# 取得 excel 檔中各個 sheet name 的方法如下:
1. 建立並打開 OleDBConnection
2. 以 OleDBConneciton.GetOleDbSchemaTable 取得 data table
3. 以 DataRow["TABLE_NAME"] 取出 sheet name
4. 關閉並釋放 OleDBConnection

範例程式如下
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.Text;

namespace ExcelSheet
{
 class Program
 {
  static void Main(string[] args)
  {
   OleDbConnection objConn = null;
   DataTable dataTable = null;
   try
   {
    // connection string
    String connString =
    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
    + "D:\\Excel.xlsx" + ";Extended Properties=Excel 12.0;";
    // Create and Open OleDbConnection
    objConn = new OleDbConnection(connString);
    objConn.Open();

    // Get the data table
    dataTable =
    objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,null);

    if(dataTable == null)
    {
      Console.WriteLine("no table");
    }

    foreach(DataRow row in dataTable.Rows)
    {
     // Write the sheet name to the screen

     //就是在這取得Sheet Name
     Console.WriteLine(row["TABLE_NAME"].ToString());
    }
   }
   catch(Exception e)
   {
    Console.WriteLine(e.ToString());
   }
   finally
   {
    // Close and dispose the connection
    if(objConn != null)
    {
     objConn.Close();
     objConn.Dispose();
    }
    if(dataTable != null)
    {
     dataTable.Dispose();
    }    
   }
  }
 }
}
參考於 微軟技術討論區 

Vista 上安裝 SQL2005 時出現 IIS 警告訊息

在Vista系統上安裝SQL2005時會因IIS版本的問題出現錯誤訊息





















reporting services 會安裝不起來
找了一些訊息

解決方面 在微軟的網站有說明
http://support.microsoft.com/kb/920201/zh-tw

徵狀
使用進階 Services 上執行下列作業系統之一的電腦上安裝 Microsoft SQL Server 2005 或 Microsoft SQL Server 2005 Express Edition:
• Microsoft Windows 伺服器程式碼名稱 " Longhorn " Beta 2 作業系統
• Microsoft Windows Vista 作業系統
在這種情況下, 會您收到下列警告訊息為 SQL Server 2005 安裝程式中 [ 系統組態檢查 ] 頁面上 IIS 功能需求 項目:

Microsoft Internet Information Services (IIS) 無法安裝或已停用。 為 IIS 所需某些 SQL Server 的功能。 沒有 IIS, 某些 SQL Server 的功能將無法進行安裝。 如果要安裝所有 SQL Server 功能, 從 [ 新增或移除程式 ] 在 [ 控制台 ] 安裝 IIS 或啟用 IIS 服務透過 [ 控制台 ] (如果已經安裝, 然後再執行 SQL Server 安裝程式。 如需清單在 IIS, 相依的功能請參閱支援 Supported by Editions of SQL Server 線上叢書 》 中的功能。

發生的原因
會發生這個問題是因為並非所有的 IIS 7 元件, 取決於 SQL Server 安裝在您的電腦上。

下表列出受影響的元件。


      元件               資料夾
靜態內容            通用 HTTP 功能
預設文件            通用 HTTP 功能
HTTP 重新導向          通用 HTTP 功能
目錄瀏覽            通用 HTTP 功能
ASP . NET         應用程式開發
ISAPI 擴充程式         應用程式開發
ISAPI 篩選器         應用程式開發
Windows 驗證         安全性
IIS Metabase         管理工具
IIS 6 WMI         管理工具

請注意 資料表中的資料行的 資料夾 列出在哪些元件所在資料夾。 您在執行 IIS 7 安裝程式時遭遇這些資料夾。

只要在IIS安裝時,把上述的元件都勾選安裝,錯訊訊息就不會出現了。

如何修正CalendarExtender在updatePanel中發生錯位問題

最近在玩AJAX Tools時用了CalendarExtender
但有問題是如果把 CalendarExtender 放入 updatePanel時
會出現css設定在網頁上出現版面問題
所以查了一下資料
在網路上找到了一個解決方式
post出來避免自己忘了

引用
http://www.cnblogs.com/doraeimo/archive/2007/07/24/829997.html
如大大有問題請告知@@ 內容如下

最近用到了CalendarExtender,结果不知道为什么发生了错位,如图


在Google和百度上找了很久,中文的文章里面似乎只提到了如何本地化(就是显示中文的月份)以及怎么解决被下拉框挡住的问题,谈到格式错位的好像没有,我最后在官方论坛上找到一篇文章,解决了这个问题,就在这儿贴一下~应该也算是个bug吧,可能在0618之后的版本会有补丁。

解决的方法是在调用CalendarExtender的页面所引用的css里,添加下面这段用于覆盖原来CalendarExtender的样式

.ajax__calendar_container {padding:4px;position:absolute;cursor:default;width:170px;font-size:11px;text-align:center;font-family:tahoma,verdana,helvetica;}
.ajax__calendar_body {height:139px;width:170px;position:relative;overflow:hidden;margin:auto;}
.ajax__calendar_days, .ajax__calendar_months, .ajax__calendar_years {top:0px;left:0px;height:139px;width:170px;position:absolute;text-align:center;margin:auto;}
.ajax__calendar_container TABLE {font-size:11px;}
.ajax__calendar_header {height:20px;width:100%;}
.ajax__calendar_prev {cursor:pointer;width:15px;height:15px;float:left;background-repeat:no-repeat;background-position:50% 50%;background-image:url(WebResource.axd?d=x6lt9HfG5Si8NZjMNt1DLcY6US8hUl3G4muzIFtahMQFZTbwxJ00qsx5N8jeAW90ZvGxZ6SJJh48yx62JKItzQ2&t=633053122925312500);}
.ajax__calendar_next {cursor:pointer;width:15px;height:15px;float:right;background-repeat:no-repeat;background-position:50% 50%;background-image:url(WebResource.axd?d=x6lt9HfG5Si8NZjMNt1DLcY6US8hUl3G4muzIFtahMQFZTbwxJ00qsx5N8jeAW90HZemRms4wXOo1BZWTwWtNQ2&t=633053122925312500);}
.ajax__calendar_title {cursor:pointer;font-weight:bold;}
.ajax__calendar_footer {height:15px;}
.ajax__calendar_today {cursor:pointer;padding-top:3px;}
.ajax__calendar_dayname {height:17px;width:17px;text-align:right;padding:0 2px;}
.ajax__calendar_day {height:17px;width:18px;text-align:right;padding:0 2px;cursor:pointer;}
.ajax__calendar_month {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;}
.ajax__calendar_year {height:44px;width:40px;text-align:center;cursor:pointer;overflow:hidden;}

.ajax__calendar .ajax__calendar_container {border:1px solid #646464;background-color:#ffffff;color:#000000;}
.ajax__calendar .ajax__calendar_footer {border-top:1px solid #f5f5f5;}
.ajax__calendar .ajax__calendar_dayname {border-bottom:1px solid #f5f5f5;}
.ajax__calendar .ajax__calendar_day {border:1px solid #ffffff;}
.ajax__calendar .ajax__calendar_month {border:1px solid #ffffff;}
.ajax__calendar .ajax__calendar_year {border:1px solid #ffffff;}

.ajax__calendar .ajax__calendar_active .ajax__calendar_day {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}
.ajax__calendar .ajax__calendar_active .ajax__calendar_month {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}
.ajax__calendar .ajax__calendar_active .ajax__calendar_year {background-color:#edf9ff;border-color:#0066cc;color:#0066cc;}

.ajax__calendar .ajax__calendar_other .ajax__calendar_day {background-color:#ffffff;border-color:#ffffff;color:#646464;}
.ajax__calendar .ajax__calendar_other .ajax__calendar_year {background-color:#ffffff;border-color:#ffffff;color:#646464;}

.ajax__calendar .ajax__calendar_hover .ajax__calendar_day {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_month {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_year {background-color:#edf9ff;border-color:#daf2fc;color:#0066cc;}

.ajax__calendar .ajax__calendar_hover .ajax__calendar_title {color:#0066cc;}
.ajax__calendar .ajax__calendar_hover .ajax__calendar_today {color:#0066cc;}

參考上面大大的方式
就可以正常的顯示及使用
大家參考看看了