Some steps might help:
1. Run devenv /resetsettings and click View->Server Explorer
2. If step 1 is useless. try to run devenv /safemode and click View->Server Explorer.
2008年8月20日 #
Some steps might help:
1. Run devenv /resetsettings and click View->Server Explorer
2. If step 1 is useless. try to run devenv /safemode and click View->Server Explorer.
2007年12月26日 #
public class ClassA
{
public event EventHandler Event1;
public EventHandler Delegate1;
private string id;
protected virtual void OnEvent()
{
if (this.Event1 != null)
{
this.Event1(this, EventArgs.Empty);
}
}
public ClassA()
{
this.Delegate1 = delegate(object sender, EventArgs e)
{
Console.WriteLine("Delegate");
};
}
public void Test()
{
OnEvent();
}
}
ClassA a = new ClassA();
EventInfo ei = typeof(ClassA).GetEvent("Event1");
FieldInfo fi = typeof(ClassA).GetField("Event1", BindingFlags.Public | BindingFlags.Instance);
private event EventHandler Event1;
public void add_Event1(EventHandler value)
{
// Do addition.
}
public void remove_Event1(EventHandler value)
{
// Do removal.
}
FieldInfo fi = typeof(ClassA).GetField("Event1", BindingFlags.NonPublic | BindingFlags.Instance);
public event EventHandler Event2
{
add
{
}
remove
{
}
}2007年4月26日 #
2007年2月15日 #
画立体柱图应该非常的简单,就是两个截面+柱体。所以我就不做多的描述了,请直接看代码吧:

/**//// <summary>
/// Draw Bar Chart
/// </summary>
/// <param name="g"></param>
/// <param name="value"></param>
private void DrawBarChart(Graphics g, double value)
{
double val = value > 100 ? 100 : value;
// Compute size and location
Point pt = new Point();
int width = 100;
int height = 16;
int eclipseWidth = 4;
Rectangle r1 = new Rectangle(pt, new Size(eclipseWidth, height));
Rectangle r2 = r1;
r2.X += width;
Rectangle r3 = r1;
r3.X = r1.X + (int)(width * (val / 100.0));
Rectangle r4 = r1;
r4.X = pt.X + (eclipseWidth / 2);
r4.Width = width;
Rectangle r5 = r4;
r5.Width = (int)(width * (val / 100.0));
Pen redPen = new Pen(Color.Red);
Pen greenPen = new Pen(Color.Green);
GraphicsPath gp1 = new GraphicsPath();
gp1.AddEllipse(r1);
GraphicsPath gp2 = new GraphicsPath();
gp2.AddEllipse(r2);
Region rgn1 = new Region(r4);
rgn1.Exclude(gp1);
rgn1.Union(gp2);

gp1 = new GraphicsPath();
gp1.AddEllipse(r1);
gp2 = new GraphicsPath();
gp2.AddEllipse(r3);
Region rgn2 = new Region(r5);
rgn2.Exclude(gp1);
rgn2.Union(gp2);
LinearGradientBrush lgb = new LinearGradientBrush(pt, new Point(pt.X, pt.Y + height), Color.Black, Color.Yellow);
lgb.SetBlendTriangularShape(0.5f, 1.0f);
g.FillRegion(lgb, rgn1);
lgb = new LinearGradientBrush(pt, new Point(pt.X, pt.Y + height), Color.Navy, Color.Green);
if (value > 100)
{
lgb = new LinearGradientBrush(pt, new Point(pt.X, pt.Y + height), Color.Navy, Color.Red);
}
lgb.SetBlendTriangularShape(0.5f, 1.0f);
g.FillRegion(lgb, rgn2);

PathGradientBrush pb = new PathGradientBrush(gp1);
pb.SurroundColors = new Color[]
{ Color.Gray };
pb.CenterColor = pb.CenterColor = Color.LightYellow;
g.FillEllipse(pb, r1);
Font f = new Font(FontFamily.GenericSansSerif,9.0f);
string text = string.Format("{0}%", value);
if (value > 100)
{
text = "过期未完成";
}
Color fntColor = Color.White;
if (val < 50)
{
fntColor = Color.Purple;
}
RectangleF textRect = this.ComputeTextRectangle(g, r4, f, text);
g.DrawString(text, f, new SolidBrush(fntColor), textRect, StringFormat.GenericTypographic); 
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "image/jpeg";
string error = Request["error"];
string progress = Request["progress"];
MemoryStream ms = new MemoryStream();
Bitmap bmp = new Bitmap(110,17);
using (Graphics g = Graphics.FromImage(bmp))
{
g.Clear(Color.White);
if (string.IsNullOrEmpty(progress))
{
error = "1";
}
if (!string.IsNullOrEmpty(error))
{
this.DrawError(g, int.Parse(error));
}
else
{
this.DrawBarChart(g, double.Parse(progress));
}
}
bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
}2007年2月14日 #
数据对于企业来说及其重要,像前几天的一个晚上,我们公司突然断电,CRM服务器没有UPS电源,所以造成两块硬盘出现Media Error,我们的磁盘采用RAID5的方式,将其中一块Force Online后,还是不能Rebuild,进不了操作系统. 幸亏装了双系统,从另外一个OS启动将数据全部取出来了.算是有惊无险的一次吧.
现在我将其进行自动备份到其他机器上去,作一个双保险.
1. 在Master数据库中建一个格式化时间的函数
Create function FormatDate(
@date smalldatetime
)
returns nvarchar(10)
begin
declare @dt nvarchar(10);
set @dt = SubString(Convert(nvarchar(20),@date,120),1,10); --格式化为yyyy-MM-dd HH:mm:ss格式,与后面的批处理日期格式保持一致
return @dt
end
2. 创建一个备份数据库的存储过程
/*
* 在磁盘上根据日期创建一个文件夹,并将数据库备份到文件夹内
*/
Create Proc BackupCRM
as
begin
declare @path nvarchar(200);
declare @crmfilename nvarchar(200);
declare @metafilename nvarchar(200);
declare @cmd nvarchar(1000);
set @path = 'E:\Backup\' + dbo.formatdate(getdate()) + '\';
set @crmfilename = @path + 'CRM.bak';
set @metafilename = @path + 'Meta.bak';
set @cmd = 'md ' + @path;
--为了安全,建议还是将xp_cmdshell改名
exec xp_cmdshell @cmd,NO_OUTPUT
backup database _0105237670_MSCRM to disk = @crmfilename;
backup database _0105237670_METABASE to disk = @metafilename
end
3. 创建清空文件和复制文件的批处理命令
a.用于备份数据库前清空文件的批处理文件clearfiles.bat
del E:\Backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\CRM.bak
del E:\Backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\Meta.bak
说明: %date%可以获得日期的字符串,但我们需要用~ index,len来截断并组合成yyyy-MM-dd格式的字符串,这和SubString函数类似,index表示字符串的起始索引位置,len表示要截取的长度.
如果想看到自己Server的%date%输出格式是什么,可以输入 echo %date%,我们的Server输出是Wed 02/14/2007
b. 复制文件至远程机器批处理文件copyfiles.bat
md \\10.89.53.250\e$\backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\
del \\10.89.53.250\e$\backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\CRM.bak
del \\10.89.53.250\e$\backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\Meta.bak
copy E:\Backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\CRM.bak \\10.89.53.250\e$\backup\%date:~10,4%-%date:~4,2%-%date:~7,2%
copy E:\Backup\%date:~10,4%-%date:~4,2%-%date:~7,2%\Meta.bak \\10.89.53.250\e$\backup\%date:~10,4%-%date:~4,2%-%date:~7,2%
4. 启动SQL Agent服务,并设为开机自动运行,然后新建一个备份的Job
注意将批处理执行失败后的动作设为"执行下一步操作",否则如果文件不存在等可能会导致Job不能正常运行

最后在Schedules中新建一个Schedule,当然选择的运行的时间点就是那种风高月黑夜深人静的时候罗:)
2006年11月25日 #
2006年8月8日 #
2006年6月16日 #
2006年2月10日 #
2006年2月5日 #