|
Do u want to display a icon for the dll's that u create in C#?
if yes then write the following code before the class
[ToolboxItem(true)]
[ToolboxBitmap("icon_application.bmp")]
The string in quotes is the bmp file that u need to include in
your project.
Hope that works for u
Regards,
Pramod
|
|
|
|
|
Pramod, I think that he wants to associate his application with certain filetypes rather than set an icon for his actual application
|
|
|
|
|
that's y i asked him wht really he wants to do...
Thanks & Regards
Pramod
|
|
|
|
|
hi, I am trying to execute a dos command and I found this code fragment:
<br />
System.Diagnostics.Process proc = new System.Diagnostics.Process();<br />
proc.EnableRaisingEvents=false;<br />
proc.StartInfo.FileName="calc";<br />
proc.Start();<br />
The problem is, I wish to execute a command AND monitor the return code. Thank you!
|
|
|
|
|
Well the return code can be found by using
<br />
proc.ExitCode<br />
You can Kick off any Dos command by simply calling the dos exe/bat file/whatever
<br />
proc.StartInfo.FileName = @"ipconfig";
proc.StartInfo.Arguments = @"/renew";
proc.Start();<br />
If you want more control of how the process runs though you can use ProcessStartInfo - you can then handle passing in details and handling errors etc, even stop the command line window coming up at all.
|
|
|
|
|
|
I have a repeater with 2 nested repeaters inside to display multi-tier data.
The first Repeater contains Customer Information.
The Second Repeater contains Call Tracking Information
The Third Repeater contains Comments
The data currently displays like so:
Customer Info: Blah Blah Blah
Call Tracking Information: Blah
Comments about each Call Tracking Issue: Blah...
My query to obtain customer information looks like so:
"SELECT HSCTI.ItemID, HSCTI.Cust_Name, HSCTI.Region, HSCTI.Contact_Date, HSCTI.Reason, HSCTI.Status FROM HSCTI WHERE HSCTI.Status = 'Open'";
My ItemDataBound to my first Nested Repeater looks like:
public void Customers1_ItemDataBound(Object sender, RepeaterItemEventArgs e) <br />
{<br />
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) <br />
{<br />
Repeater oRPT = (Repeater)e.Item.FindControl("Customers2");<br />
DataRowView oDrv = (System.Data.DataRowView)(e.Item.DataItem);<br />
oRPT.DataSource = oDrv.CreateChildView("<HSCTI>");<br />
oDrv.DataView.RowFilter = "HSCTI.Status = 'Open'";<br />
oRPT.DataSource = oDrv;<br />
oRPT.DataBind();<br />
}<br />
}
I keep getting an error indicating:
System.ArgumentException: This constraint cannot be enabled as not all values have corresponding parent values
Can someone tell me how to fix this?
Thank you.
Tim
|
|
|
|
|
I've updated a connectionString manually on IIS and restarted Web site,
but previously working INSERT is not working to the new data source.
New connectionString is okay (see details below).
I know I can have multiple connectionStrings, but don't know
how to select one of them on the fly.
I don't know how to handle this situation.
Any help will be very appreciated.
Thanks in advance!
Eugenio
DETAILS:
I'm running an ASP.NET Web Service (IIS 5.1).
Web service INSERTs a couple of records successfully into a DataSet
created using DataSet Wizard on VS2005 to a SQLEXPRESS on local machine.
I've the same database on a remote SQLSERVER (that I can access thru
MS SQLServer Mgmt Studio Express), and wanna INSERT data to it.
So I manually changed Web.config to the new connectionString on IIS and
restarted the Web site that I'm using. Data obviously did not go to the
old database, but it did not go to the new too! (although my code haven't
thrown any exception). Data has been lost.
Second turn, I configured the code to use an ODBC System DSN to the
old and okay database. Worked fine. Changed the DSN settings to the
remote database (connectionString remained the same) as restarted
Web site on ISS. The same behaviour got before: data was lost!
Eugenio
|
|
|
|
|
How can I prevent Cut'n'Paste between a couple of text boxes. An operator is required to enter a serial number twice to help prevent errors. The problem is they enter it once and then Cut'n'Paste.
|
|
|
|
|
Here's two ideas:
- add a keydown event to the text boxes and detect CTRL+C or CTRL+Insert (I'm a little foggy on it, but doesn't specifying it as "handled" prevent the control from processing the key? Something about that in MSDN library...)
- add an enter-event to the text boxes that clears out the clipboard
|
|
|
|
|
If you're using Visual Studio 2005, simply set the "ShortcutsEnabled" property of the TextBoxes to false.
Otherwise, please do not use suggestion 2. Well-behaved software citizens should not clear anything out of the clipboard unless requested by the user.
--
I've killed again, haven't I?
-- modified at 17:45 Monday 30th January, 2006
|
|
|
|
|
You're right (about being well-behaved), Office Lineman. Thanks for the tip!
|
|
|
|
|
Why do you make the user enter the number twice? The only time this behavior is needed is when it's a password, and the user can't visually verify that they're entering the right thing.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
The operators enter a new serial number every two to three minutes all day long. Normally this is done with a barcode scanner but if the label is damaged they need to enter it with the keyboard. This serial number is written to EEPROM on the PCB under test. If they get it wrong, the board will have to go back through the programing cycle. The extra time, to enter it twice every so often, is worth avoiding the programing cycle. Additionally, the mistake might not be discovered until the board is installed in the final product. (Lots of wasted time...)
Greg
|
|
|
|
|
|
Hi folks
I'm trying to get the javascript variable in the HTML page loaded in WebBrowser control through IHTMLDocument2 interface. In VB6 it was simple: "WebBrowserInstance.Document.parentWindow.variableName".
But, I stuck in MSHTML interfaces.
Could somebody help me with that?
Thanks
|
|
|
|
|
You may get variable in this way :
IHTMLDocument2 document2 = (IHTMLDocument2)axWebBrowser1.Document;<br />
object variable= document2.parentWindow.GetType().InvokeMember ("variableName", <br />
BindingFlags.GetProperty, <br />
null, <br />
document2.parentWindow, <br />
new Object [] {});
The snippet below shows how to set the variable
document2.parentWindow.GetType().InvokeMember ("variableName", <br />
BindingFlags.SetProperty, <br />
null, <br />
document2.parentWindow, <br />
new Object [] {"New value"});
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Does anybody know a good hashcode algorithm to generate unique codes?
What if you have two objects and their properties are equal? How would a hashcode be unique then?
Here, I am making an assumption that the hashcode is created using the properties of the control.
So I guess the real question is: Is there a way to generate a unique hashcode that doesn't rely on the properties of the object?
Thanks
Eric
|
|
|
|
|
Create a hashcode from the reference pointer.
---
b { font-weight: normal; }
|
|
|
|
|
Does the hashcode need to be unique/same across sessions? What're you using it for: uniqueness testing or sorting? If you don't need cross session consistancy or can save the code somehow, and are only using it for uniqueness testing: just give each object a guid.
|
|
|
|
|
If you need a unique hashcode that doesn't depend on the properties try the timestamp instead or you can use guid instead of calculating them on your own.
Greetings,
Ingo
|
|
|
|
|
Be aware that if comparison of instances return true , like in:
obj1.Equal(obj2) == true
then they must return the same hashcode.
obj1.Hahscode() == obj2.hashcode()
So, if you implement your own hashcode that is unique for every instance, make sure to override the Equal method to always return false .
If you don't do that, your class won't be usable in Arrays and Hashtables.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Thanks for all the suggestions.
Much appreciated.
Eric
|
|
|
|
|
Hello,
Lets say I built my app on a machine that has Excel 2003 installed. So, the interop assembly created was built off of 2003.
Now, I have a few questions on what would happen if I ran the following code on a machine that had, lets say, both Excel 2000 and Excel 2003 installed.
using Microsoft.Office.Interop.Excel;
...
ApplicationClass app = new ApplicationClass();
MessageBox.Show(app.Version);
app.Quit();
...
1. If the user has both Excel 2000 and Excel 2003 installed, which one will be started? Will it always start the latest version?
2. If no Excel is installed at all, would app be null after the call to new ApplicationClass() or would that call not even be able to run?
Thanks.
|
|
|
|
|
I'm trying to compile a little C# program with the commandline csc compiler. I'm using the [DLLImport()] attribute, so I need the System.Runtime.InteropServices namespace, right? Problem is, csc wants to know what assembly it's from (there's no DLL named System.Runtime.InteropServices.dll). I need it for the /r: switch for csc.exe. Anyone?
|
|
|
|