|
this:
DataSet _ds=dbc.GetDataSet().Clone();<br />
combo_state.DataSource=_ds.Tables[0].DefaultView;<br />
equals:
combo_state.DataSource = dbc.GetDataSet().Clone().Tables[0].DefaultView;
I think, no?
But I found the problem. Clone() only copies the structure. no data. You have to use the Copy() method to copy the data and the structure.
like this:
<br />
combo_state.DataSource = ((DataView)combo_nationality.DataSource).Table.Copy().DefaultView;<br />
combo_state.DisplayMember = "lbl";<br />
combo_state.ValueMember = "country_id";<br />
tnx for the help.
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
yes. your answer is right
|
|
|
|
|
|
Hello!
I have a problem, I'm trying to read an XML-file that may contain characters from different languages, like for example swedish, danish or german non-ascii characters.
when i load the reader into my xmlDoc, i get an exception telling me that one of the caracters is invalid.
is there any setting i can do to make the xmlreader ignore what kind of caracters the element includes?
Can i have something to do with the header (i have xml-files with no header)
example xml:
<rootNode>
<firstChild>
<grandChild>normal</grandChild>
</firstChild>
<secondChild>
<grandChild>äää-not-normal</grandChild>
</secondChild>
<rootNode>
kind regards
Andreas
-- modified at 2:52 Friday 4th August, 2006
|
|
|
|
|
Specify the encoding when you create the streamreader. Example:
StreamReader reader = new StreamReader(fileName, Encoding.GetEncoding("windows-1250"));
---
b { font-weight: normal; }
|
|
|
|
|
I recommend fixing the XML document instead of trying to make your program read invalid XML.
See for example here[^]
The default encoding is UTF-8, if you use anything else you must
a) Specify it in the header
b) Kill yourself to save the world from yet more ANSI junk. Only exception is if you use another Unicode encoding (UTF-16 for example), but normally this is not needed.
|
|
|
|
|
First of all, what is your code, what reader are you using? An xml reader, DOM, SAX, or a text reader?
No doc type (header)?? That's actually not valid XML. Is it possible to include it? Short of a Byte order mark, w/o the doc type there is NO way to accurately figure out the encoding of file.
If you can't add the doc type to your XML doc, you must specify the encoding in your code. UTF-8 would be a safe guess.
-- modified at 3:03 Sunday 6th August, 2006
-- modified at 3:04 Sunday 6th August, 2006
/\ |_ E X E GG
|
|
|
|
|
Hi,
I want to know is it possbile to add a user to windows programtically? if yes,please point me to the header files and Dll which i should add in my Project for doing this and the method call i should perform for doing this.
Thanks in Advance
Deepa
|
|
|
|
|
|
hi all i have this pro on hand now.. i have downloaded some sample database applications from the internet..however when i want to debug it i gives me the error--An unhandled exception of type "system.Data.OleDb.OledbException" occurred in system.data.dll
does this errors occur due to where the dB file is located..is it correct? can someone out there help will this pro? and maybe guide me to correcting it ..thanks in advance..
an extract on of codes where the problem is highlighted is below:the pro is bold...thanks in advance
private void fclsMain_Load(object sender, System.EventArgs e)
{
m_cnADONewConnection.ConnectionString =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\contacts.mdb";
m_daDataAdapter =
new OleDbDataAdapter("Select * From Contacts",m_cnADONewConnection);
OleDbCommandBuilder m_cbCommandBuilder = new OleDbCommandBuilder(m_daDataAdapter);
m_daDataAdapter.Fill(m_dtContacts);
this.ShowCurrentRecord();
one of the ans i got is entering cnADONewConnection.Open();
before m_daDataAdapter.Fill(m_dtContacts);
but i got an error like this C:\Documents and Settings\STUDENT\Desktop\Database Example\Form1.cs(235): The type or namespace name 'cnADONewConnection' could not be found (are you missing a using directive or an assembly reference?)
can anyone please give me more detailed help as im really new to this
|
|
|
|
|
Make sure you have all the DLLs needed on your machine, and then make sure they are all referenced.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
could u tell me how i can solve this with more details thanks
|
|
|
|
|
Goto www.google.com.
Search for Oledbconnector drivers. Look for the ones from microsoft.
Download them.
Add them as a reference.
If that doesn't work then the way you explain the problem needs to be described better.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
I am using C# to set parameters and calling a .rdl report (SQL Reporting services) in a report viewer object(in C#).
The data for the report is being generated by stored procedures in the backend.
My doubt is
' How do we post a message when the report does not display any data' ?
Can this be done after the report is generated or in any other way' ..
Thank you,
Nit
|
|
|
|
|
Check to see if any data is being taken from the query and if not display something saying just that.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
This method returns the string twice! How?
public string UniversalRegEx(string szMyRegEx, string szWhatFor, string szWhatThrough)
{
//The universal RegEx
//Set it (Query, What it will put as a heading)
Regex rxFind = new Regex((szMyRegEx), RegexOptions.IgnoreCase);
MatchCollection matches = rxFind.Matches(szWhatThrough);
foreach(Match m in matches)
{
szInformation = (szWhatFor + ": " + m.Groups["mmatch"]);
}
return szInformation;
}
I am stuck on this. I use this method and it works, but when I have it search for Residence, it returns szInformation twice some how. Is there a ghost in the code?
Thanks for your time.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
A function can not return more than a single value. What exactly do you mean when you say that it returns something twice?
---
b { font-weight: normal; }
|
|
|
|
|
That is what I thought but when I run the function it returns two different strings on one call. I have been running through my code over and over to see if it is called more than once and it isn't.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
ExpertComing wrote: That is what I thought but when I run the function it returns two different strings on one call. I have been running through my code over and over to see if it is called more than once and it isn't.
I still fail to understand how it can be. Can you create a simple application (e.g., a Main() only, with a Console.WriteLine() call) showing your problem?
I don't see dead pixels anymore...
Yes, even I am blogging now!
|
|
|
|
|
ExpertComing wrote: That is what I thought but when I run the function it returns two different strings on one call.
No, it doesn't. A method can only have one return value. Period. There is no exception. Ever.
Why do you think that it returns two strings?
---
b { font-weight: normal; }
|
|
|
|
|
what do you mean by returning twice. is it that when u call function like
string result = UniversalRegEx(...);
result contains "Returned ValueReturned Value" rather than "Returned Value"???
Regards
Shajeel
|
|
|
|
|
No, what I do is call the function like this to display the results.
StringRegEx(">Profession <mmatch>[a-z]+)", "Vocation", szCharacterProfile))
It outputs:
Vocation: Knight
Vocation: Knight
Why???!!!
If you wish to help me and look at the live code, is there a way to transfer e-mail addresses in a way that is non-public. That is the only way I'll share my live code.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
you gave the code for function UniversalRegEx() and here you are calling StringRegEx()???
where are you writing the output. is it using console.writeline() or some textbox.
as for function returning twice, why dont you just add break point on the function return and check how many times it reaches there?
Regards
Shajeel
|
|
|
|
|
You must skip the first entry in the groups - it contains everything matched (as if there was a paranthesis around the entire expression).
-- modified at 2:44 Friday 4th August, 2006
|
|
|
|
|
ExpertComing wrote: foreach(Match m in matches)
{
szInformation = (szWhatFor + ": " + m.Groups["mmatch"]);
}
Why would you step through all the matches and not accumulate their contents ? Why not just ask for the last one in the group, it's the only one you're going to get.
You need to post the calling code. This code cannot return twice, no code can. You must be calling it twice. However, I do note that your return value is not created within the call, perhaps it's being a member variable is somehow contributing to the problem.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|