|
I always use:
using System.Resources;<br />
...<br />
ResourceManager myResources = new ResourceManager("Namespace.File", Assembly.GetExecutingAssembly());
And it always works fine for me.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
File = // the file.htm ? //
How do I reterive from that data , my resource html.
HtmlDocument hDoc = myResources... ?
|
|
|
|
|
Not quite, if you add a new resource file to your project, then add your files to that.
Alternitavely, you can embed the html file (so, set it as an embedded resource in its properties) and access it like this:
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("file.htm");
And that returns a stream to the file.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
10x alot.
I'll try :
HtmlDocument hDoc = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Tool.htm");
|
|
|
|
|
Hello everybody,
here is my problem. I need to create a DLL that runs a form. On this form there are some Data created. I need to get acces to this Data from a Webform. I have allready created the DLL, but I can't run the form.
How can I start running a form in a DLL?
And how can I access data, that is created in this form in the DLL?
Thanks for your help.
|
|
|
|
|
edepede wrote: I need to create a DLL that runs a form. On this form there are some Data created. I need to get acces to this Data from a Webform. I have allready created the DLL, but I can't run the form.
I'm slightly confused. You want to get data from a web form or a win form? You need to run the form to get the data from it, is this data the user has just entered, or is the form getting data from somewhere else? If the user is entering the data, is this the same user that will see the webform?
Please clarify your situation because I don't understand it.
|
|
|
|
|
I want to get the Data from a win form. I need to run the form, because I'm using special controls to get the data from somewhere. The controls need a win form!
Now i want to display those data on a webform, because i want to host a page where I'm diplaying those data.
So no user is entering something, I just need the data from those controls. And they need a win form.
Am I clear?
|
|
|
|
|
edepede wrote: I want to get the Data from a win form. I need to run the form, because I'm using special controls to get the data from somewhere. The controls need a win form!
You want to get the data from "somewhere". That is a bit vague, isn't it? Why does this data need to arrive through a winform control? It sounds like it is increadibly badly designed. The control should never know anything about where its data comes from, it just receives it.
So, where does the control get the data from? And, where did this control come from anyway?
|
|
|
|
|
Hello
VS 2003.
I am trying to hide some columns in a datagrid. The datagrid is bound to a typed dataset data source.
This is the code I have used to set the column width to zero. However, as there are many columns to hide I get left with a bold black line where the column should have been. So the customer doesn't want to see this. This is the code I used, just wondering is there a better way to do this.
Many thanks,
Steve
<br />
DataGridTableStyle tblStyle = new DataGridTableStyle();<br />
tblStyle.MappingName = "OrderDetail";<br />
grdBeverages.TableStyles.Add(tblStyle);<br />
<br />
grdBeverages.DataSource = DS.OrderDetail.DefaultView;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["OrderDetailID"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["BeverageID"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["Beverage"].Width = 50;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["BeverageQty"].Width = 40;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["BeverageQty"].HeaderText = "Qty";<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["BeverageCost"].Width = 40;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["BeverageCost"].HeaderText = "Cost";<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["StarterID"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["Starter"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["StarterQty"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["StarterCost"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["MaincourseID"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["Maincourse"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["MaincourseQty"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["MaincourseCost"].Width = 0;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["TotalCost"].Width = 40;<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["totalCost"].HeaderText = "Cost";<br />
grdBeverages.TableStyles["OrderDetail"].GridColumnStyles["OrderID"].Width = 0;
|
|
|
|
|
|
you may also try something like this
DataGrid1.Columns(1).Visible = False
hope anyone may be of some help!
|
|
|
|
|
Hello,
This is using the Compact Frame 2.0
I have found some code that seems to work. However, the idea of the grid is for the user to keep adding new products to the datagrid. Even though the columns that are needed are added ok. When the user attempts to add a second row there is an error. ""Value does not fall within the expected range". This happens each time, after the first one has been successfully added. 2nd one onwards.
I thought it might be the tblStyle object, but as I am creating a new one each time, I am surprised to get this error.
Many thanks,
Steve
DataGridTableStyle tblStyle = new DataGridTableStyle();<br />
tblStyle.MappingName = "OrderDetail";<br />
<br />
DataGridTextBoxColumn column = new DataGridTextBoxColumn();<br />
column.MappingName = "Beverage";<br />
column.HeaderText = "Beverage";<br />
tblStyle.GridColumnStyles.Add(column);<br />
<br />
column = new DataGridTextBoxColumn();<br />
column.MappingName = "BeverageQty";<br />
column.HeaderText = "Quantity";<br />
tblStyle.GridColumnStyles.Add(column);<br />
<br />
grdBeverages.TableStyles.Add(tblStyle);
grdBeverages.DataSource = DS.OrderDetail.DefaultView;
Many thanks if you have any ideas about this,
Steve
-- modified at 9:31 Monday 12th November, 2007
|
|
|
|
|
Im trying to delete a file from windows service in c#
file delete or fileinfo.delete and get Access to the path X is denied
how can i solve this?
Samele code will be greate help
thanks
|
|
|
|
|
poqeqw wrote: Access to the path X is denied
Sounds like a permission issue. Are you sure the permission is set right and the file is not open by another process?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
You might want to check the account under which the service is configured to run. Open "services.msc" and see the properties for your service on the "Log On" tab of the properties dialog. If it is "Local System account" and its a local file you're trying to delete (i.e. not a file on a network share) then you should certainly have permission. In that case it may be that the file has been locked by some other process.
If it is some other user account then verify that that account has the required permission for the file.
|
|
|
|
|
hi all
how i can to sort the datatable column ?
the colums data type is string ,but i fill this column with date as string .
when i sort the column is get me the date ,
1/11/2007 is less than 2/10/2007 ??
by means the code is sorted by the first index of string .
the code is :
datarow= datatable.select("","Date ASC");
how i can sorte the row in this table by the column date ?
thanks for any body hellp me
Thaer
|
|
|
|
|
Change the data type of the column in your datatable to DateTime .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Change the data type to datetime.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hello everyone,
I am currently developing an interface for a third-party 3d engine.
Current scenario: I need to store object references. For this to happen, I'm using List<t> collections.
These Lists might contain the same object reference (one list can have visible interface objects to render, and another one could have the same objects, a the z-sorting list for instance).
Is this a correct way of storing multiple references, or is there a better method you can shed some light on (performance-wise, or just coding-wise)? Is this going to produce GC issues?
I have read about WeakReferences in a reply over these forums but I'm not sure about their usage in this context.
Thanks for reading and for any further reply,
Rob
|
|
|
|
|
Roberto Collina wrote: Is this a correct way of storing multiple references, or is there a better method you can shed some light on (performance-wise, or just coding-wise)? Is this going to produce GC issues?
A reference just points (or refers) to the actual object. If you store an object reference on two different lists all that is happening is that you now have two places that point (refer) to the same actual object.
It won't cause GC problems. The garbage collector will only remove an object when nothing refers to it any more.
In terms of performance, if you need a list sorted by Z-Order and a list of visible only objects for different purposes then it will probably improve performance. You just need to ensure that the lists are kept up to date an in sync with each other.
Roberto Collina wrote: I have read about WeakReferences in a reply over these forums but I'm not sure about their usage in this context.
A weak reference is a reference to an object that CAN be garbage collected. In other words you cannot rely on the reference, it may suddenly become null without you realising.
Obviously, if you have something that is a weak reference and you assign it to something then it becomes a stong reference and the garbage collector won't touch it.
Weak references are rarely needed and from the information you've given I don't see why you would need them.
|
|
|
|
|
|
Set the DataSource of your ComboBox to be the clients DataTable object contained within your DataSet instead of the DataSet itself.
Omit the table name prefix when setting the DisplayMember and ValueMember properties of your ComboBox.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I would like to be able to detect changes in files so that when A file/folder is monitored whilst the program is running it fires an event, or it is detected on start-up if the changes happen when the program is not running.
Does anyone have any general ideas on how to go about doing this such as APIs that would help me out rather than coding it for me, (of course that would be nice :P)
Thanks.
|
|
|
|
|
|
this is the sequence of filesystem(subject) question
I GOT ONE PROBLEM AGAIN
HERE IT IS TAKING THE FILE NAME WITH EXTENSION WHAT I HAVE TO DO TO IGNORE EXTENSION
REGARDS
SUNILWISE
|
|
|
|