|
Have you added
using System.Drawing;
to the top of the file?
|
|
|
|
|
|
Hi all,
Can anyone help...im trying to figure out a way to get the value to text of a node...the problem is that my query returns around 2000 rows...i want to make it that i must click on a node to get its subnodes...how will i go about doing this?
living life on the flip side
|
|
|
|
|
|
Hello,
I am working in my application with xml files and mdb file,I don't want user view these files I want to put them in the app assembly.
Thanks.
Dad
|
|
|
|
|
yes it works for xml files but I don't know if mdb will work or won't work.
1. add a classLibrary project in your solution,
2. add the xml files into your new classLibrary project.
accessing to xml:
System.Reflection.Assembly xx = System.Reflection.Assembly.Load("yourNewClassLibraryProjectName");
string ress = xx.GetManifestResourceNames();
and you will read with xmlSerializer.
I'm not sure if you can change dinamically that xml files or not... .
modified on Wednesday, July 16, 2008 8:23 AM
|
|
|
|
|
The only real purpose of including the mdb file in the assembly is to have an already structured template for database creation/editing. You would not be able to edit the files embedded into the assembly. If you want to 'obscure' what the user can and cannot see with regards to the actual database file, I would suggest that you give it a 'critical application important file' type name. Second I would suggest that you give it an abnormal database extension. Ex. For my RevCorp accounting software I wrote, I labeled the file: AppData.revdb. Their was a copy of the file stored in the assembly. When the file could not be found in the directory where it was run the database was created from the assembly.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I have created a setup of a win project and i installed the project on client machine.now i update my project and create a new version of setup.
now on client machine it shuld be updated it self
i need your help
thanx
|
|
|
|
|
ali zaidi wrote: now on client machine it shuld be updated it self
Not unless you have written some code in your app to do it. Google for .net deployment, there are loads of articles showing the problems and pitfalls.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi All,
Can anyone tell me wat im doing wrong...im trying to populate a treeview from sql with a foreach loop...my code is like this..
foreach (DataRow dr in dt.Tables)<br />
{<br />
<br />
}<br />
Please tell me wat im doing wrong?
living life on the flip side
|
|
|
|
|
if dt is a DataSet then dt.Tables is a collection of Table s, not DataRow s. If dt is a DataTable (as the name suggests) you want dt.Rows
|
|
|
|
|
thanks alot...works like a bomb...thanks to all
living life on the flip side
|
|
|
|
|
ok thanks for your help but now i have another question...im trying to add subchild nodes to childnodes... my code
ListItem lstItem = new ListItem();
foreach (DataRow row in dt.Rows)
{
TheNode13.Text = "";
lstItem.Value = row["ID"].ToString();
lstItem.Text = row["Name"].ToString();
TheNode13.Text = lstItem.Text;
TheNode13.Value = lstItem.Value;
TheNode12.Nodes.Add(TheNode13);
}
everytime i add them then it overwrites the subchildnode and add the same node twice...wat am i doing wrong?
living life on the flip side
|
|
|
|
|
You need to instantiate a new TreeNode each time.
|
|
|
|
|
try dt.Tables[0].Rows
rahul
|
|
|
|
|
foreach (DataRow dr in dt.Tables.Rows)
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I'm busy working on some user controls...
these are made up of 2 panels on which data is drawn using GDI+ in the form of time lines and clocks. On the time lines i have maskedTextBoxes with the mask "##:##" and in turn shows up as "__:__" when empty.
In the TextChangedEventHandler of each maskedTextBox I try to parse the value to a DateTime property, so if the user input is a valid time the corresponding property to the maskedTextBox is set.
Also in the TextChangedEventHandler the method DrawData() is called which sets some private bool's when certain groups of these DateTime properties are filled in correctly. Ex if the start and stop time of a break is filled in as 09:00 and 09:30 a pie will be drawn behind the clock representing the break.
so far so good. The irritation sits in the containing forms designer code. As per a different thread monday(i think) i noticed my properties set block was getting executes BEFORE the user enteres text in the MaskedTextBoxes. So upon construction of the control all my MaskedTextBoxes had "00:00" in them instead of "__:__".
It was later discovered that the containing form initailizes the properties in its designer code which was executing my set blocks.
as a work around i did the following...
private DateTime postEnd = new DateTime();
public DateTime PostEnd
{
get
{
return postEnd;
}
set
{
postEnd = value;
if (postEnd != new DateTime())
{
mtxtPostEnd.Text = postEnd.TimeOfDay.ToString();
}
}
}
this was working but only for a few of the properties, the others was STILL SHOWING "00:00"
i went screwing around in the designer code again and this is what i found...
this.breakClockControl3.AfterTime = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.BreakEnd = new System.DateTime(((long)(0)));
this.breakClockControl3.BreakStart = new System.DateTime(((long)(0)));
this.breakClockControl3.BreakType = "Windo";
this.breakClockControl3.Dock = System.Windows.Forms.DockStyle.Fill;
this.breakClockControl3.Duration = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.Location = new System.Drawing.Point(3, 3);
this.breakClockControl3.Name = "breakClockControl3";
this.breakClockControl3.PostEnd = new System.DateTime(2008, 7, 17, 0, 0, 0, 0);
this.breakClockControl3.PostGrace = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.PostRound = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.PreGrace = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.PreRound = System.TimeSpan.Parse("00:00:00");
this.breakClockControl3.PreStart = new System.DateTime(2008, 7, 17, 0, 0, 0, 0);
this.breakClockControl3.ShiftEnd = new System.DateTime(2008, 7, 17, 0, 0, 0, 0);
this.breakClockControl3.ShiftStart = new System.DateTime(2008, 7, 17, 0, 0, 0, 0);
this.breakClockControl3.Size = new System.Drawing.Size(486, 317);
this.breakClockControl3.TabIndex = 0;
as you can see some of the DateTime's are initialized as new System.DateTime(((long)(0))); which is perfect and others like new System.DateTime(2008, 7, 17, 0, 0, 0, 0); which screws up my work around
Why does the designer do this? i don't get it...
any ideas on what i can do?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
This is to do with DesignerSerialization. Look up on how to suppress properties, set defaults, visibility, etc.
|
|
|
|
|
thanx leppie
google here i come!
it just makes no sense to me that two of the exact same things gets initialized to two different values for no apparent reason, stupid MS...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
i solved the issue by doing the following
private DateTime breakEnd = new DateTime();
[DefaultValue(typeof(DateTime), "00:00")]
public DateTime BreakEnd
{
get
{
return breakEnd;
}
set
{
breakEnd = value;
if (breakEnd != new DateTime())
{
mtxtBreakEnd.Text = breakEnd.TimeOfDay.ToString();
}
}
}
i just hope it holds up...
thanx again for pointing me in a direction
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: i just hope it holds up...
Why? Your dev station a bit unpredictable?
|
|
|
|
|
no, but Visual Studio is
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
I was thinking about this more the other day but haven't had chance to try any code so I haven't reposted. The problem lies in the public properties that the form must set (to zero or the equivalent). If you made the properties private remove the properties but created public methods to set/get them the private member variables (sort of what a property does internally anyway) then the form wouldn't automatically mess with the values - only when it was instructed to call the methods.
Dave
|
|
|
|
|
hi
i'm working on hiding data in structure of microsoft word document 2003
my problem is how i access to document stream and table stream in strucutre of word
i think i must entring the root first
please help me
|
|
|
|
|
you can use IFilter that reads pure text of a document. It's amazing )
but I don't know how to reach that table stream
|
|
|
|