|
Hello Everybody,
I have generate an error while building on Dll
Cannot register assembly "MYDLL.dll" - access denied. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Thanks
If you can think then I Can.
|
|
|
|
|
Can you register it with regsrv32? You need administrative privileges for registering a dll, because it writes some data to HKEY_CLASSES_ROOT in the registry.
|
|
|
|
|
How can i register it. Because Error is generate while i am Compiling my dll.
If you can think then I Can.
|
|
|
|
|
Is this a .NET DLL ?
This Simply means you don't have permissions to create Files in that local drive.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
But I am Running Visual Studio in Administrative mode. and if i am block some code then it will working fine.
If you can think then I Can.
|
|
|
|
|
|
Hi!
How can I take data from a dataset and populate a List<>()?
Illegal Operation
|
|
|
|
|
A List of what type?
You could use Add to add an instance of type T to a List<T>
You could use Add to add a DataSet to a List<DateSet>
So what is it you want?
|
|
|
|
|
I need to create a list of type Dataset. Here is my code at the moment
List<<DataSet>> dsList = new List<<DataSet>>();
dsList.Add(payClass.GetPayItems());
How would I bind that list to a ListBox?
P.S - I added to << and >> because when posting it removes it.
Illegal Operation
|
|
|
|
|
A ListBox can hold and show all kinds of items; by default, it calls ToString() on each of its items to visualize them.
There is an alternative by turning the ListBox into "OwnerDrawn" mode, which means you set out to provide all the code required to paint one item, see the DrawItem event.
If you were to bind a List<DataSet> to a ListBox, it would turn each DataSet into a single item in its collection; unless your DataSet has overridden its ToString() method, the net result would be something similar to the string "System.Data.DataSet" which I guess is not what you want. And painting a DataSet yourself would be a challenge.
So I think you are tackling this the wrong way. I'm not so sure what it is you really want to achieve.
PS: you can get proper < > & signs by using the little widgets above the editor box.
|
|
|
|
|
Luc,
I have dataset that contains Items from my database. What I want to do is list all those payitems in listbox1 and then enable to user to add selecteditems to listbox2.
Illegal Operation
|
|
|
|
|
Well, AFAIK a DataSet can only contain DataTables; so maybe you have one or several DataTables that hold DataRows with such payitem information. The easy way of presenting one DataTable to a user is by using a DataGridView (assuming you are talking about a WinForms application).
While I'm not an expert on DataTables and the like, I recently published my CP Vanity[^] article that uses both DataTable and DataGridView. I would suggest you read the MSDN documentation on the relevant classes, and have a look at my app. Assuming it looks like what you have in mind.
|
|
|
|
|
string result = "";
append("Ali","Salim",&result);
public void append(string a, string b, string result)
{
result = a +" "+ b;
}
Error:
Error 11 Argument '4': cannot convert from 'string*' to 'string' D:\app\pup\Code\TBrectangular.aspx.cs 23 262 D:\app\
|
|
|
|
|
It's telling you that result and &result are not the same thing. However, your public void append(string a, string b, string result) wouldn't do much anyway, since you can't modify function parameters without explicitly specifying.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
this is the C# forum, your code does not compile here.
|
|
|
|
|
While in c++ that would work just fine, C# doesn't let you manage pointers or references directly without declaring a block of code unsafe (it might be worth it for you to look up the unsafe keyword and how to use it)
What C# does give you for just this type of thing is another couple of keywords for your parameters, ref and out . Both will allow you to pass the reference to your string so that you can modify it inside the function, but there is one main difference.
Using the out keyword you can pass in an uninitialised variable that you expect the function to fill in. The ref keyword will only allow you to pass in variables that have been initialised as it expects the function to use and modify it.
So, for this type of thing you can simply use the out keyword;
string result;
append("Ali", "Salim", result);
public void append(string a, string b, out string result)
{
result = a +" "+ b;
}
Now, on a slightly different topic, if you plan on combining a lot of strings you may simply want to use the StringBuilder class, as it is a lot more efficient than simply adding two or more strings together.
My current favourite word is: Smooth!
-SK Genius
|
|
|
|
|
Or why not simply return the string like a normal person?
|
|
|
|
|
Now you surprise me.
|
|
|
|
|
hey,
i'm listening to key_down event,
when it's fired, the following code are executed
private void typingTextBox_KeyDown(object sender, KeyEventArgs e)
{
char key = (char)e.KeyValue;
if (!e.Shift)
key = Char.Parse(key.ToString().ToLower());
wg.checkClickedKey(key);
}
but the problem is, that code is executed twice...
how it can be fixed ?
thanks
|
|
|
|
|
my guess is that you've add an extra handler somewhere. Check your code and see how many
myTextBox.KeyDown += typingTextBox_KeyDown
statements there are. Remember there might be one in the designer code.
|
|
|
|
|
absolutely right...
somehow it was generated twice in designer code....
thanks
|
|
|
|
|
Btw, how about char.ToLower ?
|
|
|
|
|
right, much simpler
thanks
|
|
|
|
|
FYI: the KeyDown/KeyUp events don't, but the KeyPress event offers a KeyPressEventArgs.KeyChar holding the character in its correct casing for free... however it only fires for keys that contribute to document content, not modifier keys such as shift, control, alt, ...
|
|
|
|
|
so how this casing can help me ?
|
|
|
|