|
Ehy, it's event driven...
You have to override the OnPaint method of the for with your drawing code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi
i want to insert my DataGridView1.columns (TableStyle or ColumnStyle) to another dataGridView..
How to do ??
thanks
|
|
|
|
|
I was going to help you out and,
I have tried a few different ways but I seem to keep getting the error "Column Belongs to another Table" no matter how I do it. Its not like there is an option to import datacolumns like you can with datarows. So Id like to see this done as well I am now curious.
|
|
|
|
|
Hello everyone,
I have some experience of C# development on Windows desktop. Now I am learning how to develop GUI application using C# on WinCE device, based on .NET Compact Framework.
Are there any samples/tutorials to make reference for a beginner?
thanks in advance,
George
|
|
|
|
|
Hi
im trying to Limit the number of results retrived by a Query so for Example i want to retrive the first 30 and then navigate throw the results 30 by 30.
the problem in my Query that i cant used the TOP 30 command because im Ordering my results with date then status plus alot of ordering.
and this ordering will cause the retrived results to be retrived in a random ID_no order as one of my friends suggested that i use the TOP 30 along with
Where Id no > X Order BY Id_no as in the example below.
but i think if there is no Command in MS Access or that i dont know it because of my lack of knowledge i will have to order by my Where Criteria along with the TOP 30 command.
Another Sol. just popped to my head is to save the results to a Dataset and then using a Table in the Dataset i can just retrived Index based.
i guess i will try the Dataset sollution also if there is any better one plz Help.
By the way im using ODBC COnnection, OdbcCommand and ODBCDatareader.
Thanks in Advance.
Example for Retriving by the TOP and Where command:
1)
Select TOP 30 A.ID_no , .......etc<br />
From A , ......etc<br />
Where A.ID_no > 1<br />
Order by ID_no ;
2)
Select TOP 30 A.ID_no , .......etc<br />
From A , ......etc<br />
Where A.ID_no > 30<br />
Order by ID_no ;
and i continue like that.
Have fun and Stay good
-- modified at 4:16 Saturday 25th November, 2006
|
|
|
|
|
What control are you using to display the data? I think you can 'throw' all data into the control and enable paging on the display control.
|
|
|
|
|
I am trying to write a function in C# (VS2005/Net 2) which will pack and upack bits into a byte, short, integer and so on. As an example I have an Int32 in a file which is packed such that bits 0 thru 10 are one value and bits 11 thru 31 another. In another I have a short where the first 3 bits represent a value and so on thru. I have been playing around using bit shifting but it is not working. I am guessing that it may be something to do with the way the types are stored - I am no expert o nthis stuff but I wonder if they are little endian so the bit sequence is turned around by pairs.
Any pointers would be much appreciated
Jon
|
|
|
|
|
ScruffyDuck wrote: I have been playing around using bit shifting but it is not working.
Standard question #1:
What do you mean by "not working"?
ScruffyDuck wrote: wonder if they are little endian so the bit sequence is turned around by pairs.
The value is first read from memory into the CPU, then it's shifted, so it doesn't matter how it's arranged in memory.
---
b { font-weight: normal; }
|
|
|
|
|
By not working I mean that the answer I get is not the correct one e.g. I am expecting 12345 as an answer and I am getting 21436 so I think I am ending up with extracting the wrong bits.
Jon
|
|
|
|
|
Maybe that with a sample of the code (and of the file) you will make our lives far easier... )
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Unless you actually show the code that you tried, the only thing that anyone can say about it is that it's wrong.
I assume that the example that you showed was not an actual value that you are using, as they have totally different bit patterns? It would be more helpful if you showed some real examples of what you are using. Any information that you withhold is directly affecting the assistance that you can get.
---
b { font-weight: normal; }
|
|
|
|
|
OK apologies for not being very precise. The file I am dealing with is very large and the packed information forms a very small part of it. When extracted it has to go through another transformation. What I am trying to understand is generally how to write a function which will take a set of bits out of a larger set and return their value as an Integer. For example if I have 32 bits in a UInt32 then this is what I tried:
public static UInt32 Dword (UInt32 data, int start, int end) {
UInt32 result = data << (31-end+1);
result = result >> (31 - end + 1 + start);
return result;
}
I am sure the code is very poor with magic numbers and so on but if I take the example of cutting out bits 3 thru 7 inclusive then I left shift to remove bits 8 thru 31 then right shift until bit 3 is not bit 0. I have absolutely no experience of dealing with bit manipulation.
Apologies again if I am not clear but it is because I really don't know what I am doing here
Jon
|
|
|
|
|
Hi,
both +1 terms should be dropped, as you can see from these simple cases:
if you want all bits (so start=0, end=31) then no shifting should occur.
if you want the LSB (start=end=0) then it should read (data<<31)>>31
if you want the MSB (start=end=31) then it should read (data<<0)>>31
When shifting one more in both directions, you actually loose the most significant bit of
your bit field.
Luc Pattyn
|
|
|
|
|
Instead of shifting the data back and forth to get rid of unwanted bits, use a bit mask.
If you want bits 3 through 7, use a bit mask where those bits are set to one, and use the binary and operator (&) to clear the unwanted bits:
mask = 0x00f8;<br />
data = data & mask;
Then shift the data the three bits to place it at bit zero and up:
data = data >> 3;
---
b { font-weight: normal; }
|
|
|
|
|
OK Thank you everyone - it is now working
Jon
|
|
|
|
|
hi...
In my MDI application , i have one child form(ChildForm) & object of that form i am adding on every click of one MenuItem(i have three Menu items- ManuItem1,Manuitem2 & menuItem3) in my parent form & on click of the MenuItems i'm making that form(ChildForm) as a child form of my parent & i am displaying that child form. Now i want that child form to have three ToolStripButtons & three events for that toolstripbuttons.
i have added 3 ToolStripButtons while making that ChildForm initiallly only. I have made them public also but they are not available when i want to access them in my ParentForm class. I am clicking each MenuItem & declaring object for childForms. I am able to dispaly the form but i am not able to access those ToolStripButtons. I have a RichtextBox as other Control on that Form.
How i can do this...?
Thanks & regards,
Vinay
|
|
|
|
|
hi everyone, im having a strange problem connecting to .mdb file from c#, while the same application is connecting fine with oracle, each time i made some changes in the forms and save them using the binding navigator tool strip, the changes are not saved the next time i open it, please help
|
|
|
|
|
Hello everyone,
I am wondering whether there are any tools that can convert Java source codes to C# source codes? I have a simple Java program, which uses only basic Java classes and some JDBC/Swing classes to do database/GUI functions.
thanks in advance,
George
|
|
|
|
|
Google
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
It seems that you are an expert, any recommendations?
regards,
George
|
|
|
|
|
Hi,
How can i call a function from another when i only have the name of the function in a string parameter. I want to call the second function with the designated parameters and get the return value.
<br />
public double F2(string param1, int param2)<br />
{<br />
<br />
}<br />
<br />
public void F1(string FunctionName)<br />
{<br />
}<br />
Please help
Do your best to be the best
|
|
|
|
|
double res;
res = F2("",0);
or
F2("",0);
|
|
|
|
|
You need to use Reflection here.
The following code is not complete but I think it will help you.
using System.Reflection;
.....
public void CallMethod(string methodName)
{
MethodInfo methodInfo = this.GetType().GetMethod(methodName);
if (methodInfo == null)
{
throw new MissingMethodException(this.GetType().Name,methodName);
}
methodInfo.Invoke(this, new object[] { "Param1", 50 });
}
public void MethodToBeCalled(string param1, int v)
{
Console.WriteLine(param1);
Console.WriteLine(v);
}
|
|
|
|
|
Why, oh why, would you identify the method using a string?
Perhaps you should explain what it is that you are trying to accomplish, instead of asking how it's done the way that you think that it should be done.
---
b { font-weight: normal; }
|
|
|
|
|
how can i add connection string in the web.config and how can i change the server name from this file by code?
fatma
|
|
|
|