|
hi,
i have a windows project in C# that uses some DLL i wrote in different projects.
i want to make this application to run from the web page on the local computer(ActiveX,OCX).
how can i do it?
thanks,
Samy
|
|
|
|
|
I need to read 4 hexadecimal chars from a textbox and put them into a Uint
how can I do that?
BiG RaLpH
|
|
|
|
|
|
I need to see if I can change the hex 2.
ie:
textbox2.text = "1212abab"
the uint returned must be 1212 and another abab.
BiG RaLpH
|
|
|
|
|
Hi,
you could:
1. use long.TryParse() and then split the long in upper and lower halfs.
2. split the string in two parts, and use int.TryParse() on each of them.
The second method may be more difficult since it may have to cope with varying string lengths
when leading zeroes are omitted in the string.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
You can use
uint num = Convert.ToUInt16(textBox1.Text, 16);
If the textbox contains more than 4 letters and if you want to change each 4 letters in to their uint value, you should first write a text splitter which is very simple with string.substring() function.
Best Regards
Zafer
|
|
|
|
|
I have an application that i have deployed using winforms. I have many users using this application and it works for every1 except one person!!!! I cannot isolate the problem. She gets the following error:
EventType:clr20r3
P1: admin.exe
P2:1.0.0.0
P3:464caceb
P4:admin
P5:1.0.0.0
P6: 464caceb
P7:42
P8:4c
P9:system.nullreferenceexception
I want a line number or something that give me a damn hint on where the null exception is occuring. I received this info from the event viewer. HEELLPP!!!
|
|
|
|
|
After doing a quick search on google, and selected the top result, I got This result[^]. See if that helps you out.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
What you can do is set an application level thread exception handler. This is the top level event exception handler that is capable of catching exceptions. Then, you can simply extract the stack trace of the error that caused this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have a gridview and a dataset. When I start my application I see the results in my gridview. When I clic on edit and chanche some value and click on update it wil give me this error:
ObjectDataSource 'ObjectDataSourcePersoon' could not find a non-generic method 'Update' that has parameters: naam, tussenvoegsel, achternaam, adres, woonplaats, telefoonnummer, original_id, Original_naam, Original_tussenvoegsel, Original_achternaam, Original_adres, Original_woonplaats, Original_telefoonnummer.
check here my dataset update method
Does someone know whats the problem??
|
|
|
|
|
Your objectdatasource needs to have a update method that has the parameters that you see in the error. IN that method you should run a sql statement that updates the sql database. You perhaps have put an update method in your objectdatasource definition, but it probably doesn't match the one defined in the error. NOTE the columns are auto generated based off the columns in the gridview.
Hope that helps.
Ben
|
|
|
|
|
But why in the wizzard I see for SELECT, INSERT, UPDATE and DELETE a method. See it here:
click here
|
|
|
|
|
Hello all. I have a datagridview (genericGrid) and a bindingsource (genericBS). genericGrid's datasource is genericBS. I want to programmatically switch genericBS's DataSource and Datamember. Then, display those values on the genericGrid.
What I've tried:
Using a switch statement to change genericBS's DataSource and DataMember properties on the load. Then, called genericBS.ResetBinding(true). This is supposed to force genericGrid to refresh its rows. Amazingly, it doesn't work.
What actually works:
I've resorted to creating a bindingsource for each table. Then using a switch statement to change genericGrid.DataSource. This works.
But, there has to be a way to use just one bindingsource, right? Any suggestions?
Lester
http://www.lestersconyers.com
|
|
|
|
|
Got an enum. Got 2 get methods for it. One returns the instance of the enum itself, one intends to return the int used in the enum.
public enum elementTypes
{
normalText = 0,
hidden = 1,
programData = 2,
}
There are more but this is an idea.
As I said I'd like to be able to get the actual number, not the name or an instance.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
The only way I know of doing this is:
elementTypes et;
//This will give you the number
(Int32)et.hidden;
Hope that helps.
Ben
|
|
|
|
|
Fantastic.
Out of lack of skills, what the heck does the (Int32) prefix do? Is it some sort of implicit conversion?
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Right. It casts the Enum as a number. It is kind of silly, but it the only way I know of to get the enums numerical value. I am sure someone else will post a different way of doing it, but that is the way I normally do it.
Ben
|
|
|
|
|
OK...
Thanks.
Ninja (the Nerd)
Confused? You will be...
|
|
|
|
|
Yeah here's another way:
int number = enum as int;
XD
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
The Undefeated wrote: int number = enum as int;
that will not be accepted, for one "as" requires a reference type, not a value type.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
*shakes fist angrily at Luc*
You ruin everything
int Waffle(ref Enum myEnum)
{
return myEnum as int;
}
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
no no.
Error: The as operator must be used with a reference type ('int' is a value type)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
*cries*
Perhaps if i actually tried to use the code before i posted it.
*cries some more*
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Yeah, the sensible sequence is:
- try to understand the problem at hand
- read the documentation
- try a couple of things
- search for a solution for the remaining problems
- only then post at CodeProject
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Ninja-the-Nerd wrote: what the heck does the (Int32) prefix do? Is it some sort of implicit conversion?
No, it's an explicit conversion.
An implicit conversion is when the conversion is done without specifying the data type, this is allowed when widening types, like from a byte to an int. Example:
byte data = 42;<br />
int moreData = data;
An explicit conversion is when you specify the data type. This is used to tell the compiler that you want the conversion eventhough the compiler doesn't know if it will always work, or when an implicit conversion isn't allowed, like with an enum. Example:
int data = 42;<br />
byte lessData = (byte)data;
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|