發表文章

目前顯示的是 九月, 2018的文章

VS2017.15.8.4 錯誤修正

圖片
最近一直不太敢安裝Vs2017的更新,尤其是跳版號的,每次裝都有問題,這次要從15.7.x升上15.8.4,安裝後,果然不出所料...專案全部無法載入..
解決方式 根據訊息到開發論壇找到了解答如下:
1.使用管理者權限打開Developer Command
2.輸入以下的命令列 gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Engine.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Conversion.Core.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll" gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Utilities.Core.dll"
完成後,需重新打開方案才會正常載入。
參考來源 https://developercommunity.visualstudio.com/c…

SQL Server傳遞資料集到預存程序

今天同事提到他將資料集用參數的方式丟到預存程序裡面,大致的作法如下:
1.資料庫宣告資料表型別 CREATETYPEdbo.USER_TABLE_TYPE ASTABLE(        USER_NOVARCHAR(8) )
2.C#宣告一個DataTable及參數 vartable =newDataTable();             table.Columns.Add(newDataColumn("USER_NO", System.Type.GetType("System.String")));             table.Rows.Add(table.NewRow());             table.Rows[0]["USER_NO"] ="Abc"; varpar =newSqlParameter             {                 ParameterName ="userTable",                 Value = table,                 SqlDbType = SqlDbType.Structured,                 TypeName ="dbo.USER_TABLE_TYPE"             };
3.預存程序參數宣告 CREATEPROCEDUREdbo.GetUsers        @userTable USER_TABLE_TYPE READONLY AS BEGIN SELECT*FROM@userTable