Jumat, 13 Juni 2008

another post

woah it's been a long time i don't post on this blog
i've been through some business,
which drawn me to no where.
You can see my other blogs.
on http://geeks.netindonesia.net/blogs/cipto/

Minggu, 09 Maret 2008

Proverty in indo

While every daily needs is increasing now.
especially recently from the Fried oil.. for cooking dunno what you call in english,
touching around 15.000 per kg.
i've heard a dramatic news. that cause it is so unaffordable , there are some poor people who cook with sand. . .
sounds awkward right?
but yes it's true . . .
when it's shown on tv, it can fried but not crispy result.
so what's next?

in indonesia, when it's poor it's very poor, but when the rich is extremely rich.
so there's no balance , i think the national developments should touch to this dilemma

Rabu, 05 Maret 2008

In the Middle of No Where

dear blog. . .
after a series of incident in my job
i think it takes more than just a hard work and intelligent.
so many those little things that make us more wise and success.
i finally got in some trouble and being put in a middle of no where

Hmm.. this is a nice obstacle or Exam in my life
it makes me think what about if some day i've no job or if i'm on business
how about if my business Bankrupt...
or how about if i dedicated in a company and then the company bankrupt.
There's nothing that is eternal in this (Fana) World.

Yet on every point in my life, there's has to be a solving way of any trouble
gee, what a headache that i've got.
despite i pass and revive again, it would be a start over

very sad though. . .

Kamis, 21 Februari 2008

Adding validation and business rule on DataTable

Open Dataset Designer , right click on the DataTable you wanted.
it will create partial class YourDataTableName.
and then on the
Create your Validation Sub
For instance
void CheckWorkTypeID(DirectCostRow directcostrow)
{
if (directcostrow.WorkTypeID == 0 || directcostrow.WorkTypeID == DBNull.Value)
{
directcostrow.SetColumnError("WorkTypeID", "Please Input A WorkTypeID");
}
}

Rabu, 20 Februari 2008

Why My table doesn't appear on Local Data Chace Designer

1.Are not in the user’s default schema.

Note:
To determine which schema is being displayed, inspect the text above the list of tables. The text appears in the following format: Tables on 'DatabaseName.SchemaName'. The SchemaName listed is the current default schema. For information about default schemas, see User-Schema Separation in SQL Server 2005 Books Online.


2.Table Doensn't have a primary key defined.

3.Have names longer than 118 characters.

4.Contain columns with data types that are not supported by SQL Server Compact 3.5.

Handle Data Conflicts and Errors ADO.NET Synchronization

partial class LocalDataCache1ServerSyncProvider
{
protected override void OnChangesSelected(ChangesSelectedEventArgs value)
{
base.OnChangesSelected(value);


}
public override SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
{
return base.GetChanges(groupMetadata, syncSession);
MessageBox.Show(groupMetadata.BatchCount + " Change");
}
protected override void OnSelectingChanges(SelectingChangesEventArgs value)
{
base.OnSelectingChanges(value);

}
protected override void OnApplyChangeFailed(Microsoft.Synchronization.Data.ApplyChangeFailedEventArgs value)
{
DataTable clientchanges = value.Conflict.ClientChange;
DataTable serverchanges = value.Conflict.ServerChange;
if(value.Conflict.ConflictType==ConflictType.ClientUpdateServerDelete)
{


value.Action = ApplyAction.RetryWithForceWrite;


}
if (value.Conflict.ConflictType == ConflictType.ClientInsertServerInsert)
{
value.Action = ApplyAction.RetryWithForceWrite;
}

if (value.Conflict.ConflictType == ConflictType.ClientUpdateServerUpdate)
{
//Logic goes here.
Form1 a = new Form1();
a.ultraGrid1.DataSource = serverchanges;
a.ultraGrid2.DataSource = clientchanges;
a.ultraStatusBar1.Text = "Data has been changed by other user since your last synchronization";
a.ShowDialog();
value.Action = a.action;
}

if (value.Conflict.ConflictType == ConflictType.ErrorsOccurred)
{
//Logic goes here.
MessageBox.Show(value.Conflict.ErrorMessage, "UnKnown Error Happened:Continuing");

}

}
protected override void OnApplyingChanges(ApplyingChangesEventArgs value)
{
DataSet clientchanges = value.Changes;
}
}

Ado.net Synchronize

Hmmm...
i've try the sync one.
you just add new item localchace and
set where the Server reside.
and it will generate you everything including the client sql server compact.
you just say NameofYourChaceSyncAgent.Synchronize

and add this extracode for your localcache

partial class NameofYourChaceServerSyncProvider
{
protected override void OnApplyChangeFailed(Microsoft.Synchronization.Data.ApplyChangeFailedEventArgs value)
{
DataTable clientchanges = value.Conflict.ClientChange;
DataTable serverchanges = value.Conflict.ServerChange;
value.Action = ApplyAction.RetryWithForceWrite;
}
protected override void OnApplyingChanges(ApplyingChangesEventArgs value)
{
DataSet clientchanges = value.Changes;
}
}