|
Philip F. wrote: I'll do that.
Then you will do well.
If it helps you, back when I started trying to understand mulit-threading I found Jeffery Richters book Advanced Windows[^] extremely helpful. Keep in mind it was the first edition so no guarantees the new one is the same.
|
|
|
|
|
OleDbConnection thisConnection = new OleDbConnection(
@"Provider = Microsoft.Jet.OLEDB.4.0;Data Source=e:\DataMoney.mdb");
OleDbDataAdapter thisAdapter = new OleDbDataAdapter(
"SELECT * FROM SchoolMoney", thisConnection);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "SchoolMoney");
OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);
thisBuilder.QuotePrefix = "[";
thisBuilder.QuoteSuffix = "]";
//set up keys object for defining primary key
DataColumn[] keys = new DataColumn[1];
keys[0] = thisDataSet.Tables["SchoolMoney"].Columns[0];
thisDataSet.Tables["SchoolMoney"].PrimaryKey = keys;
DataRow findRow = thisDataSet.Tables["SchoolMoney"].Rows.Find(this.textBox1.Text);
if (findRow != null)
{
//
}
thisConnection.Close();
}
}
}
can you tell me how i get the number of row about findRow thank you
|
|
|
|
|
do you mean the index of the row that was found?
if so use this line of code where your blank comment is...
int rowNum = thisDataSet.Tables["SchoolMoney"].Rows.IndexOf(findRow);
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi,
How can i serilize and deserilize a MouseEventArgs?
Thankyou,
YPKI
|
|
|
|
|
You can't, it's not serializable.
You can create a new serializable class that holds all the property you need, populate them starting from the MouseEventArgs instance you want to save and then serialize it.
BTW, don't double-post.
|
|
|
|
|
You would have be better changing the subject of your original post to describe the problem instead of reposting.
EventArgs is marked as Serializable but not MouseEventArgs.
You can recreate the MouseEventArgs and mark your version serializable - something like:
[Serializable]
public class MyMouseEventArgs :EventArgs
{
public MyMouseEventArgs(MouseButtons button, int clicks, int x, int y, int delta)
{
_Button = button;
_Clicks = clicks;
_X = x;
_Y = y;
_Delta = delta;
}
private MouseButtons _Button;
private int _Clicks;
private int _Delta;
private int _X;
private int _Y;
public MouseButtons Button { get { return _Button; } }
public int Clicks { get { return _Clicks; } }
public int Delta { get { return _Delta; } }
public Point Location { get { return new Point(_X, _Y); } }
public int X { get { return _X; } }
public int Y { get { return _Y; } }
public static implicit operator MyMouseEventArgs(MouseEventArgs e)
{
return new MyMouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta);
}
public static implicit operator MouseEventArgs(MyMouseEventArgs e)
{
return new MouseEventArgs(e.Button, e.Clicks, e.X, e.Y, e.Delta);
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Is there some logic\reason as to why MouseEventArgs can't be serialized? Thx
|
|
|
|
|
The reason is it was never marked as Serializable by Microsoft. The logic behind that... I have no idea, you would have to ask them.
|
|
|
|
|
Only classes that have an empty constructor can be serialized.
http://doubin.blogspot.com/
|
|
|
|
|
Yeah.... I copied the source code, added an empty constructor, and serialized it.
|
|
|
|
|
Hi all,
Let’s discuss and share your knowledge on this question!!
I am sure most of the member having this question in their mind and as many as members knows the answer for this!!
Mean while, you can also ask your queries to other on same topic!!!
|
|
|
|
|
By default, parameters are passed by value.
Click me[^]
|
|
|
|
|
Groan.. I know where you're coming from - for reference types, references to objects are passed by value by default. "Passed by reference" is not entirely accurate, but it describes the object sharing aspect well.
|
|
|
|
|
Depends on whether the parameter is a reference type or a value type?
|
|
|
|
|
By default, by value (a copy).
If the parameter is a value type, it's a "copy" of that value.
If the parameter is a reference type, it's a "copy" of that reference (by reference).
If you use ref or out:
If the parameter is a value type, you pass a reference (address) to it.
If the parameter is a reference type, you pass a reference to this original reference which refers to the object. As an example of this, write a function that takes 2 arrays and swaps them (without copying the elements).
Eslam Afifi
|
|
|
|
|
If reference(from stack) to the reference type(e.g object)is passed then, whatever changes done inside the functions are reflected to the object (as another copy of reference is created on stack which also point to original location e.g object)..........isn't it??
then what is the use of ref and out keyword here???
anybody like share??
|
|
|
|
|
class A
{
public Guid Guid;
public A()
{
Guid = Guid.NewGuid();
}
}
static void Main(string[] args)
{
var a = new A();
Console.WriteLine(a.Guid);
Foo(a);
Console.WriteLine(a.Guid);
}
static void Foo(A par)
{
Console.WriteLine(par.Guid);
par = new A();
Console.WriteLine(par.Guid);
}
static void Main(string[] args)
{
var a = new A();
Console.WriteLine(a.Guid);
Foo(ref a);
Console.WriteLine(a.Guid);
}
static void Foo(ref A par)
{
Console.WriteLine(par.Guid);
par = new A();
Console.WriteLine(par.Guid);
}
Eslam Afifi
modified on Thursday, March 19, 2009 10:48 AM
|
|
|
|
|
deep@Pune wrote: then what is the use of ref and out keyword here???
ref and out pass the reference to the reference by value
|
|
|
|
|
Hello. I'm developing a Windows Mobille App, and i cannot allow users to leave the application, by clicking in start menu or side/down buttons. Can anyone help, please?
Thank you.
|
|
|
|
|
I'm developing a new steering-wheel, and I don't want you to use your brakes while you're in your car.
That didn't sound very nice, did it?
I are troll
|
|
|
|
|
My apologies for the rude comment. It's not nice to hijack someone's phone. Then again, that's no good reason for me to get rude.
Why do you need to prevent an exit? It might be a design-problem, or a requirement, but that doesn't mean that there's no (good) alternatives
I are troll
|
|
|
|
|
(sorry for the poor english)
it's an application for policemen, fine cars and things like that. i want to block the ppc so they just use the ppc for my app.
|
|
|
|
|
it's ok , i did not express myself well. i don't wanna screw anyone's phone. just making sure they just use it for theirs jobs, not going online with IE or listen to music, got it?
|
|
|
|
|
Got it a lot better than a few minutes ago
Some of the special keys are actually sent to the application, but this varies from phone to phone, since there's no standard defined. If memory serves correct, the iPaq sent the four keys on the front (under the touchscreen) as cursor-keys.
This may prove easy or very hard, depending on your phone. I'm sorry that I couldn't help you any further.
I are troll
|
|
|
|
|
What if you log every time they leave your app and send non-empty logs to HQ every 24 hours or so? Then they Can use it for something else if they Have to (for some reason) but they'd have to explain why it was necessary since HQ knows about it
If that's allowed..
Sounds like a more reasonable solution to me, but hey I'm not a police officer or their superior
|
|
|
|