2010年4月21日水曜日

SQL server 2008 のバックアップを復元できない

ユーザーが違うと復元できなくなる設定があるらしい

コンパネ > サービス で、SQLサーバーのプロパティの
ログオン タブで、ローカルシステムアカウントにチェックを入れるらしい

http://hadairotype.blog64.fc2.com/blog-entry-17.html

2010年4月20日火曜日

C#でのフォームやらコントロールやらの位置

フォームの位置と大きさ


フォームの位置を変更する
this.Location = new Point(10, 10);


フォームの位置をデスクトップ座標で変更する
this.SetDesktopLocation(10, 50);

this.DesktopLocation = new Point(10, 50);

(どっちども同じ)


フォームの位置とサイズを変更する
//位置と大きさを変更(BoundsSpecified.Allは省略可能)
this.SetBounds(10, 50, 200, 100, BoundsSpecified.All);
//位置だけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.Location);
//大きさだけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.Size);
//幅だけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.Width);
//高さだけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.Height);
//X座標だけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.X);
//Y座標だけ変更
this.SetBounds(10, 50, 200, 100, BoundsSpecified.Y);
//変更しない
this.SetBounds(10, 50, 200, 100, BoundsSpecified.None);


もしくは
this.Bounds = new Rectangle(10, 50, 200, 100);

2010年4月1日木曜日

BindingSourceのFind

tableadapterをFillしてたら、検索ができます

// つかいかた
BindingSource01.Find([検索するカラム名(string型でOK)], [検索する値(string型でOK)]);

これで、Positionが int型で返ってくる

// 使ってみた
int intPosition = this.t_M_得意先くくりBindingSource.Find("くくりID", this.くくりIDTextBox.Text);
if (intPosition == -1) { return; }
Console.WriteLine( this.cCSLOGISTICSDataSet.T_M_得意先くくり.Rows[intPosition].ItemArray[0].ToString());