10.12.08

Một số lỗi xẩy ra với MSSQL

ERROR: MSDTC on server 'servername' is unavailable.
Vào START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES. Start service 'Distributed Transaction Coordinator' .

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

Trong Management Studio, vào Tools -> Options / chọn Designer Page và bỏ chọn "Prevent saving changes that require table re-creation".

3.12.08

Load cursor from file - using user32.dll

Đảm bảo Cursor màu mè rất đẹpsengihnampakgigi
using System.Runtime.InteropServices;
using System.Reflection;
using System.Windows.Forms;
using System;

namespace myNamespace
{
public class cCursor
{
[DllImport("user32.dll")]
public static extern IntPtr LoadCursorFromFile(string filename);
public static Cursor GetColorCursor(string pathCursor)
{
Cursor mycursor = new Cursor(Cursor.Current.Handle);
//dinosau2.ani is in windows folder??
IntPtr colorcursorhandle = LoadCursorFromFile(pathCursor);
mycursor.GetType().InvokeMember("handle", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField, null, mycursor, new object[] { colorcursorhandle });
return mycursor;
}

}
}