|
That's quite easy:
Name is set at exactly one location, so the value you see is the result of this.listBox1.SelectedItem.ToString(); .
That means the selected item in your listBox1 is a DataRowView . DataRowView doesn't have an overloaded ToString method, so you simply get the type name.
But what's the question? Obviously you expect Name to be something else. Could it be that you don't want one of listBox1's items?
Without further info we can only guess...
mav
|
|
|
|
|
Try replace this.listBox1.SelectedItem.ToString(); by this.listBox1.SelectedItem.Text;
|
|
|
|
|
got it..
DataRowView dv =(DataRowView)this.listBox1.SelectedItem;
this.menuItem2.Text = dv["Beschreibung"].ToString();
Thank you
|
|
|
|
|
Hi,
Can I use c#.net to automate Outlook Express ?
Btw, are there any C# based MAPI for communicating with Outlook Express ?
Many Thanks
|
|
|
|
|
|
Thanks for ur reply.
So it means I need to access outlook express with MAPI ?
And do you know any c# based MAPI component or code reference for MAPI with outlook express ?
|
|
|
|
|
Automation does not work with Express. MS wants you to pay for Outlook to do automation.
|
|
|
|
|
Hi Geeks,
I am quite new to creating skinnable applications.
Could anyone tell me how to approach this work in C# .Net.
I checked out some links but most of them are commercial.
Basically i want to add a new feature to my application,
so that custom skins can be used as required.
Thanks,
know THE WAY,
-SimSan
|
|
|
|
|
Hi buddies,
I had an xml like "<Pu><Name>Joe&&&&&&&</Name><Age>redroom</Age></Pu>"
when i am tried with the code in c# as,
1.
tmp_Message = "<Pu><Name>Joe&&&&&&&&&&&</Name><Age>redroom</Age></Pu>";
XmlDocument xXD = new XmlDocument();
xXD.LoadXml(tmp_Message);
it is throwing error.
2.
can i get any function to check, if a given string is a proper xml or not in C#
please..... help me ..!!!! in solving this error.
regards,
vinu
|
|
|
|
|
Of course is XmlDocument.LoadXml() throwing an exception, because of all the ampersands in your string.
They must be escaped as &
Using LoadXml() in a try/catch is a way to check for proper XML.
Regards,
mav
|
|
|
|
|
hi mav,
it is not throwing error if i escaped with a single & if i use like &&&&&&&&&& then it is throwing error.
i think its not a good way, if i use try/catch to check.
please help with a solution.
vinu
|
|
|
|
|
hi mav,
it is not throwing error if i escaped with a single & if i use like &&&&&&&&&& then it is throwing error.
i think its not a good way, if i use try/catch to check.
please help with a solution.
vinu
|
|
|
|
|
Of course you have to escape every & as & .
If you do this, the xml string is correct and no exception is thrown.
AFAIK there's no ValidateXml method available, so trying to load the string and looking for an XmlException seems to be a reasonable way.
Regards,
mav
|
|
|
|
|
Thanks mav.
Regards,
Vinu
|
|
|
|
|
Thanks very much. its working now......
Vinu
|
|
|
|
|
Hi c# buddies,
I had an xml like "Joe&&&&&&&redroom"
when i am tried with the code in c# as,
1.
tmp_Message = "Joe&&&&&&&&&&&redroom";
XmlDocument xXD = new XmlDocument();
xXD.LoadXml(tmp_Message);
it is throwing error.
2.
can i get any function to check, if a given string is a proper xml or not in C#
please..... help me ..!!!! in solving this error.
regards,
vinu
|
|
|
|
|
I've posted this in the database section and got no response, so I thought I'd try here...
I need to export the contents of an SQL2000 table to a flat dbf file without any user intervention - Ie I don;t want them to have to use Enterprise Manager
Any ideas out there ???
Tks
Dave
|
|
|
|
|
whats the format for the DBF ? Is it dBase ?
I have a bunch of librarys in C to manipulate dBase databases, I'm sure it could be ported to C#
|
|
|
|
|
They are dBase III.
tell me more......
Tks
Dave
Tks
Dave
|
|
|
|
|
Well I might have jumped the gun a little bit. The library I have is from a product called CodeBase, its a real old version but I bet licencing restrictions still apply. If this is for buisness you can buy a current copy at www.codebase.com which supports .NET, but I think I have another solution. It will take some coding but I think it would work.
If your familiar with Office automation, this shouldn't be too hard.
1. Write a routine to export the Table data from SQL into a CSV file.
2. Use Excel Automation to open the CSV file and save as dBase III format.
I manually did the above tasks and got a valid dBase III DBF file (no index file though)
If you need help on the details...i.e. SQL Export routine or Excel Automation let me know.
I hope this idea works.
|
|
|
|
|
I was already working on a project that uses Excel Automation and was able to get Excel to export the WorkBook I was using into dBase III with the following line:
wsWorkSheet.SaveAs("c:\\temp\\NewDBF.DBF",Excel.XlFileFormat.xlDBF3,Type.Missing,Type.Missing,0,0,Type.Missing,Type.Missing,Type.Missing);
|
|
|
|
|
Michael
Tks - the Excel method looks possible, but its not something I've used before.
Does it mean that the user has to open up Excel to do it - if they do, then I may as well stick with Access reading the SQL table through an ODBC connection, as I am familair with that.
What I really want is something that does it all inside my .net app.......
Tks
Dave
|
|
|
|
|
Dave,
If you use Automation the user will not see a thing...You could have the whole processes linked to a single buttion click or no button at all.
|
|
|
|
|
In that case, where do I start....
Dave
|
|
|
|
|
Lets converse via e-mail rather then add 20 threads to the board....
|
|
|
|