|
Bugs like this one.. if ((CS$3$0000 == null) != null)
That's not even possible, and the IL for that part is just
L_0011: ldloc.0
L_0012: ldnull
L_0013: ceq
L_0015: stloc.1
L_0016: ldloc.1
L_0017: brtrue.s L_0020
So Mr Reflector just skipped over a load/store and made up a comparison
|
|
|
|
|
That's what I was looking for, thanks!
ShamWow
|
|
|
|
|
Hi everyone,I hope it is not in wrong place to ask, I have some isuues with Compact Frame work datagrid. It does not have much options like windows datagridview have.Can anyone please tell me how do I load data in coloumns and rows like in windows.
thanks
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:25am.
|
|
|
|
|
qwertz321, thanks for your reply. I have seen this many times but I don't know how use them. I know how to deal with regular windows datagrid and I can work with it fine. when it comes to .Net Compact framework I am lost completly because I am making change to the datagrid it does not effect anythig on the datagrid.
forexample, I want to change a particular Cell color or a column or certain row and column I am able to do that.
I am really raelly in trouble with this compact framework.
thanks
|
|
|
|
|
Hello,
I didn't know where to post this question, so I posted it here.
How do I fold all code blocks in every file in all of my project with one command?
I know there is a ctrl+m+o command, which will fold all code blocks in the current file,
but I want something that goes for all the files in my project without having to do ctrl+m+o on each single one of them.
The point is, when I open my files, I want them to be collapsed by default.
Is this the default behavior? Are they all collapsed when I open the project?
Would be nice if there was a possibility to fold all in all of the project.
Thanks
|
|
|
|
|
I'm not sure but I think the VS Power Toys might have this functionality (haven't used it for a while and don't have the link handy - Google is your friend!).
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
|
Hi all,
well simply after a thread runs, in special situation it(thread) try to refresh a form of my application and an error appeared which says that "you can not change object in other thread ..."
what should i do?
|
|
|
|
|
your description isn't very accurate, however I think this[^] is what you need.
|
|
|
|
|
hi all
i have recently created a new simple control
the problem will came up when we drop it in to the form
because it will set sum unwanted properties in Form1.Designer.cs
i set the Default Value for thees properties
[DefaultValue("89/3/24")]
and also set it in control`s constructor
but the problem still persists
|
|
|
|
|
well,
[defaultValue] is not for setting initialize value for an object, it just change appearance of the property in design time,
[DefaultValue("hello")]
public string txt{get;set}
now in design time when you change the text of this property it would be bold text!
for ur purpose u should define ur property as this:
private string _txt="Hello"; public string txt
{
get
{
return _txt;
}
set
{
_txt=value;
}
}
|
|
|
|
|
i need help on usb drive. when a user inserts a usb drive, auto run starts and diplays some of the options to select from. what i want is to add my applications exe to the list of auto run when usb drive is inserted in usb port, so that i can select my application and do some aftermath. please help. simply i want usb drive to run my application when i insert it into my computer.
|
|
|
|
|
you should pick one forum to ask your question.
|
|
|
|
|
Dear friends
i have developed a windows application the thing i want to do i want to make its demo setup so that i can give it to my clients for a period of time after that application fails to open or reinstallation
i have tried many things but i am fail to make demo
any ideas
thanx in advance
|
|
|
|
|
What part of the process is the actual problem?
|
|
|
|
|
well,
I suggest u to use a hardlock. if so u can store the information of expiration and etc. in it, else u should store those information in a hidden path in a encrypted file
this post is really useful:
Application Trial Maker
good luck
|
|
|
|
|
Greetings,
I grew up learning C and Java, so having just recently taken to C# for a new project, I'm still find my way. Hopefully this isn't a silly question
Basically I wish to build a class that contains configuration info for my application. It needs to hold a port number, a directory/folder name, and 3 arrays: an array of booleans, an array of strings for descriptive names, and an array of integers. I've written get/set methods for the server port number and the array containing the booleans, but Visual Studio 2010 is giving me a compilation error with my get/set methods for the last two arrays. "Type '......' already defines a member called 'this' with the same parameter types". Yet if a try and explicitly set the get/set method for the specific array (without using 'this'), it does not work either.
Here is the code:
namespace Test
{
public class TestConfig
{
private int ServerPort;
private String folderName;
private Boolean[] ChLog = new Boolean[12];
private String[] Label = new String[12];
private int[] CallibrationUnit = new int[12];
public int setServerPort
{
get
{
return ServerPort;
}
set
{
ServerPort = value;
}
}
public Boolean this[int pos]
{
get
{
return ChLog[pos];
}
set
{
ChLog[pos] = value;
}
}
public String this[int pos]
{
get
{
return Label[pos];
}
set
{
Label[pos] = value;
}
}
public int this[int pos]
{
get
{
return CallibrationUnit[pos];
}
set
{
CallibrationUnit[pos] = value;
}
}
}
}
Am I best to avoid using the get/set methods in this case? Or should I use a separate class for each of the arrays I'm trying to set up? (this seems very inefficient to me).
I've searched high and low for an example showing the interection of multiple array variables from within a class, but bizarrely I haven't found anything as complex is what I'm trying to do (and I don't think its that complicated).
Any feedback would be most appreciated.
Benjamin
|
|
|
|
|
Well, the issue here is that "two methods cannot differ in return type only". Here method is indexer (this), but rule is the same. You have three indexers, that only differ in return type, which means, that when you do:
<br />
TestConfig test = new TestConfig();<br />
Console.WriteLine(test[2]);<br />
Compiler will not know, which indexer you want to call, because Console.WriteLine is overriden for string, int and bool. That's why you cannot create indexers like this. You can however create indexer based on other type, for example string. So you can have
<br />
public int this[int pos]<br />
{<br />
}<br />
<br />
public int this[string pos]<br />
{<br />
}<br />
It is possible to do what you want to do, but that would require creation of three additional classes, one for each array you want to store. And indexing would be provided by fields (you have a type StringIndexerTable and field of this type in your TestConfig class).
|
|
|
|
|
Rather than having several arrays running in parallel, you could create a single array holding instances of a new class or struct. Example:
public class Channel {
public Boolean ChLog;
public String Label;
public int CallibrationUnit;
}
public class Test {
private Channel[] channels=new Channel[12];
}
The choice between class and struct is yours; for bigger objects, I would favor class, and also when references come in handy, as in what follows.
Finally, rather than setting an upper limit for the number of channels you can handle, it is often better to use a collection, as in:
public class Test {
private List<Channel> channels=new List<Channel>();
...
channels.Add(new Channel(true, "aha", 3));
Console.WriteLine(channels[3].ToString());
...
}
One advantage of generic lists is they don't need a dimension, as they can grow dynamically.
|
|
|
|
|
Hello,
I work with Active Directory In c#.
how i know when user created ?
Thank You.
|
|
|
|
|
You can use DirectoryEntry to achieve this. Here's a sample piece of code:
public void FindUser(String userName)
{
DirectoryEntry entry = GetDirectoryEntry();
DirectorySearcher search = new DirectorySearcher(entry);
string filter = string.Format("(&(ObjectClass=user)(cn='{0}'))", userName);
search.Filter = filter;
foreach (SearchResult result in search.FindAll())
{
try
{
System.DirectoryServices.DirectoryEntry de = result.GetDirectoryEntry();
Console.WriteLine("WhenCreated : " + de.Properties["WhenCreated"].Value.ToString());
Console.WriteLine("User Name : " + de.Properties["sAMAccountName"].Value.ToString());
}
catch (Exception ex)
{
}
}
}
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
Hi Folks,
I'm hoping someone can assist me with a (hopefully) simple question. Is there a way to query a database to get the type of the parameters expected by a stored proc, or the column types of a table. I know this can be done through SQL for most databases (e.g. see below, for SQL Server Column Types), but want a solution which works with any database.
SELECT name
from sys.types
where user_type_id in
(
select user_type_id
from sys.columns
WHERE object_id = OBJECT_ID('@schemaName.@tableName')
and name='@columnName'
)
Background
For anyone wanting to know more about why I'd need this, here's a little more info on what I'm attempting.
I'm writing a web service, which can act as a wrapper to any databases. The databases' connection strings will be included in the config file, using the MS Enterprise Library, so that when a call is made, the name of the DB can be included, which can then be used to get the appropriate connection.
Reading information is pretty simple; given the database name and the table / (parameterless) stored proc name the code reads from that object, and outputs data in the format <tableOrProcName><row><fieldName>...</fieldName>...</row>...</tableOrProcName>.
However, when performing inserts (and other operations where I'd need to be cognizant of data types), I'd like to query the database to get a list of expected parameter/column names and types, which I can then cross reference with the names of the XML 'Field' elements, to convert the values from strings to the correct types before populating the commandText / parameter.
Once coded, I'll make the solution available on here for anyone looking to do the same.
(For anyone wondering why we'd need a wrapper for databases, the answer is many programs these days come with simple methods for attaching to web service calls, but don't provide similar features for databases, so this is a simple & flexible workaround. Security is not an issue, since both the webservice and database are configured to only allow the service account access, so users can't use the service as a backdoor).
Thanks in advance,
JB
modified on Monday, June 14, 2010 7:50 AM
|
|
|
|
|
I get a DataReader* and use its GetSchemaTable method -- it works on all the databases I've used so far.
* I use a query like "SELECT ... FROM ... WHERE 0=1 " so the DataReader doesn't unnecessarily retrieve any data.
|
|
|
|