|
So that's what it does!
Hmm... I might try that when I next have some free time with the code (Which wont be till tommorow at the earliest)
At the moment I've just created the instance in the GUI that the user controls are added too. And then whenever the user adds another control, the ItemManager instance is passed into the new user control.
So it looks something like:
(In the create control method)
UserControl something = new UserControl(ItemManager);
And in the item manager, something like:
(In the user controls class)
private theItemManager itemManager;
public UserControl (theItemManager item)
{
itemManager = item;
}
(Incase you're wondering, I don't have the code infront of me right now)
And don't worry, all the controls are using one set of items.
Thanks for all the help you're giving me by the way.
- Munty
|
|
|
|
|
hi all,
I'm using oledb connection to read a dat file into dataset.
i've converted the dat file into txt file and created schema.ini file with |delimiter. It reads fine but my prob is no of rows count in the dataset is less than in the file(just only one row). Event i mentioned the hdr = no extended properties. Plz help
here i've given the sample code
public static DataSet FileReader(string Filename, bool SchemaRequired, DataSet dsCol)
{
string newFilename = "";
string filextn = Path.GetExtension(Filename).ToUpper();
string schemafile = "";
if(filextn == ".DAT")
{
// To change the File extension if the file type is DAT
newFilename = Path.ChangeExtension(Filename,"TXT");
File.Move(Filename,newFilename);
}
else
{
newFilename = Filename;
}
if(SchemaRequired)
{
//This Schema.ini file is required to read the text file with custom delimiters here we use(|)
schemafile = Path.GetDirectoryName(Filename)+@"\Schema.ini";
if(File.Exists(schemafile))
{
File.Delete(schemafile);
}
using(StreamWriter writer = File.CreateText(schemafile))
{
writer.WriteLine("["+Path.GetFileName(newFilename)+"]");
writer.WriteLine("Format = Delimited(|)");
for(int i = 1; i<= 19; i++)
writer.WriteLine("Col"+ i +"=C"+ i + " Text");
}
}
string PathtoTextFile = Path.GetDirectoryName(newFilename);
System.Data.OleDb.OleDbConnection oConn = new
System.Data.OleDb.OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + PathtoTextFile + ";" +
"Extended Properties=\"text;HDR=NO;FMT=Delimited\"");
System.Data.OleDb.OleDbDataAdapter oCmd = new System.Data.OleDb.OleDbDataAdapter(
"select * from "+Path.GetFileName(newFilename),oConn);
DataSet myDS = new DataSet();
try
{
oCmd.Fill(myDS);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
return null;
}
finally
{
if(SchemaRequired)
File.Delete(schemafile);
if(filextn == ".DAT")
{
Filename = Path.ChangeExtension(newFilename, "DAT");
File.Move(newFilename,Filename);
}
}
return myDS;
}
|
|
|
|
|
public static void main()
{
try
{
//some exception occured
}
catch()
{
system.out.println(" ");
}
finnaly
{
system.out.println("hai");
}
system.out.println("hello");
}
is hello wud be printd or not
plz let me know asap
with regards
|
|
|
|
|
Why haven't you tried this out for yourself? You have most of the code there, so it is a simple matter for you to test it it, except for the fact that there is no System.Out.Println - that's a Java class. Change that to Console.WriteLine and put in a divide by zero error into the try block, and you will be good to go.
BTW - please don't put SMS speak into posts. This makes it harder for the person who is reading it to understand.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
Does anybody know where the Copy Local reference property is perstisted?? I assumed it would be in the project file, but I can't seem to find the defintion.
Thanks
|
|
|
|
|
Dear all,
currently, i am developing a project where i need to display the chart which i created in Windows Form into a webpage using C#, is it possible?
Besides, is there any way to automatically update the chart base on the latest data that get from internet (use TCPIP to host to the webpage and retrieve the latest info)?
Your help is greatly appreciated.
Thank you.
Sincerely,
Velerena
|
|
|
|
|
Yes, you can very well host a windows form or windows control in a web page, for that you need to make your form as a activex control, actually u just need to use the tlbexp.exe and get the .tlb file, make sure u gice a guid attribute to your class, u have to register the tlb using regsvr32 and use it as how u ll embed a activex control in a web page , using java script.
|
|
|
|
|
Hi,
Thanks for your reply. I am a newbie in C# language, i am still doing my research on this project. My chart s display in ActiveX control. I have no idea what is tlbexp.exe and .tlb and how can i register the tlb using regisvr32? Can you please give me some guideline on this?
Thank you so much.
Sincerely,
Velerena
|
|
|
|
|
What i need to do is get a row from a nodeTag and then insert that row into a new table while editing a column value.
The code below is what i do at the moment, but it never changes the value e.g.: copiedRow[classLabel] = newValue;
DataRow row = nodeTag.OriginalRowRef;<br />
mainDataSet.Tables["Modified" + nodeTag.ClassName].ImportRow(row);<br />
<br />
DataRow[] copiedRows = mainDataSet.Tables["Modified" + nodeTag.ClassName].Select("[" + classStruct.ClassKey[0] + "] = '" + nodeTag.NodeName + "'");<br />
foreach (DataRow copiedRow in matchingRows)<br />
{<br />
if (modifiedField.Equals(FieldModified.Label))<br />
{<br />
copiedRow[classLabel] = newValue;<br />
}<br />
else if (modifiedField.Equals(FieldModified.Name))<br />
{<br />
copiedRow[classLabel] = newValue;<br />
}<br />
<br />
mainDataSet.Tables["Modified" + nodeTag.ClassName].Rows.Add(copiedRow);<br />
mainDataSet.Tables["Modified" + nodeTag.ClassName].AcceptChanges();<br />
}
|
|
|
|
|
I fixed the error, by mistake i wasnt going through the in-correct data collection. The deadly copy and paste from another section of my code was to blame!
-- modified at 9:16 Tuesday 12th December, 2006
|
|
|
|
|
Hi,
I have a treeview in my application and a
righthand click on a node should have the
same behavior as a lefthand mouseclick.
For the lefthand mouseclick I use the eventhandler
<br />
private void treeViewServer_AfterSelect(object sender, TreeViewEventArgs e)<br />
{<br />
} <br />
The righthand click should call the same handler. But
the eventhandler "click" of the treeview
<br />
private void treeViewServer_Click(object sender, EventArgs e)<br />
{<br />
}<br />
provides not the TreeViewEventArgs of the "AfterSelect"
Some ideas?
Thanx in advance
Erik
|
|
|
|
|
very urgent..
Now I am doing a project.The core of the project is the
conversion of AVI format into 3GP. I cannot get any code from net
please anybody help me
Abhilash
|
|
|
|
|
Search for mencoder, maybe you con P/invoke this stuff?
else you can read the code and implement it in c#
|
|
|
|
|
Hello everyone,
I am programming with Window Mobile and I heard that in the .Net SDK supports not only web service SDK at client side, but also offline web service module support? That is really cool!
Could anyone recommend some samples/tutorials on this topic?
thanks in advance,
George
|
|
|
|
|
This sounds like you are talking about Smart Clients. Try this article for a view:
http://www.codeproject.com/smartclient/SmartClientSOA.asp[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks Pete! The smart client is only for desktop application, other than for Windows Mobile application, right?
What I need is the ability to provide offline Web Services function for Windows Mobile application. Any comments?
regards,
George
|
|
|
|
|
George - the whole concept works for both Desktop and Mobile applications (in fact, I would say that it is better for mobile than desktop apps). Have you looked at the Smart Client Application Blocks or the Smart Device Framework?
http://opennetcf.com/CompactFramework/Products/SmartDeviceFramework/tabid/65/Default.aspx/[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for reply Pete! I have read through the document and related samples, and they are very informative. But, ... , I have not found any information about offline Web Services support ...
Maybe I am wrong or careless. Could you kindly point it from the URL/document you mentioned please?
regards,
George
|
|
|
|
|
|
Thanks Pete! This is just what I am looking for! You guy have a lot of good stuff!
regards,
George
|
|
|
|
|
No problem. I'm only too glad to help. Good luck there.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete, in this Web cast, I only find some high level descriptions. Are there any materials about,
1. how to setup environment (both client/server side);
2. a simple sample with source codes?
In MSDN, I can not find.
regards,
George
|
|
|
|
|
Hi,
Am a Intermediete C# programmer,
can you please guide me which will be the best book to buy?
thanks and regards
Karam C Bose
Thanks
|
|
|
|
|
go for any book on wrox publishers
|
|
|
|
|
I have professional c#, i find it really boring! (
|
|
|
|