|
What I believe Nick is trying to say that "#" is not valid in a Name[^] token for XML, and that the XML classes are encoding the character (it's valid in certain data, but not name tokens) in one particular way. To avoid this encoding, you shouldn't specify it at all (after all, it isn't valid for element or attribute names).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Good day all…
I am interested in adding the fading color (similar to the Windows Media Player version 10) scheme to my Main Menu. Does anyone have an object type or maybe guide to a location where I can complete this solution?
Thanks in advance for your assistance.
Have a great coding day.
Regards,
Tony D. Abel
|
|
|
|
|
Judah has answered your question below in your first post.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi,
I'm looking for a nice/good DataSet designer, where I can do nice layouts of the dataset and of the relations.
Right now my dataset has 33 tables and about 50-60 or so relations.
Ofcourse it looks more than miserable in the VS designer.
Thanks,
Corneliu.
PS>> I _can't_ redesign it, brake it, split it, change it and so on ...
|
|
|
|
|
You wrote:
I'm looking for a nice/good DataSet designer
Please point this sentance once again. What is it mean ?
Sreejith Nair
[ My Articles ]
|
|
|
|
|
"Nice DataSet designer": a designer like the one that opens when you double click an ".xsd" file in the solution explorer, where you can define tables, keys and relations all visually, and then it gets converted using the MSDataSetGenerator to code.
Tutu.
|
|
|
|
|
I would like to know the record number of the record I am referencing in a data set.
If I have a record set created with the following:
CODE:
adptLoan.SelectCommand.CommandText = "SELECT * FROM loan ORDER BY key_loan";
theRows = adptUpdateLoan.Fill(resultset, "GENERIC");
"what is my record number" = resultset.Tables["GENERIC"].Rows[0]["key_loan"].ToString();
I could change key_loan to any key value, but I still want to know what record number this is within the context of my select statement. Obviously, the one above is simplistic.
Any thoughts on this?
Thanks in Advance.
William
William Olson
e-Olsons.com
|
|
|
|
|
I am somewhat new to C#, but have built a couple of working programs.
I am working on a new project, and have a textbox control on my main form called "textBoxNumberSegments". I am building a routine for then TextChange event, with the line :
string text= this.textBoxNumberSegments.text;
The build fails with the following error:
'System.Windows.Forms.Control.text' is inaccessible due to its protection level
I have no idea how to correct this.
ngb
|
|
|
|
|
There must be a private member called text. The one you want is called Text.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
This problem will arise in two cases.
1. Some time we may create a form which is inherited from others.In this case the child form contain all controls of parents but it's accessibility is protected. So what you can do is, selected controls on your child form and change the Modifier property to public or private to that form.
2.If you are trying to access or modify the values of a form control which have the modifier private from other form.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Except he's accessing this.textBoxNumberSequence.text . Christian is right - he must use Text . The fact that he is accessing the control from this indicates that, most likely, it's defined on this 's type and is accessible regardless of it's access modifier. The only case is if the control is inheritted (this is still valid to reference inheritted members).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
If I make an HttpWebRequest, i.e. HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("http://www.google.com");, is there any way I can get the IP of the Uri (in this case google). I've fooled around with the .Address property, and looked around in the MSDN library, but I can't seem to find it. Does anyone know what property I should be using?
Thanks,
Justin
|
|
|
|
|
Ok, I couldn't figure out how to get the IP address from a HttpWebResponse object, so instead I'm using
IPHostEntry hostentry = Dns.Resolve(uri);
IPAddress = hostentry.AddressList[0];
The problem with the above is that it will not resolve a DNS entry for something like "http://www.google.com", but it will resolve an entry for "google.com" or "www.google.com". However, if you try to create a HttpWebRequest object with either of the latter two uri's, they are invalid - only the first one is valid. I only have one "address bar" in my program, so this is a bit of a problem. So, I need to find a way to get the IP, and create a HttpWebRequest given only one uri - any ideas/suggestions?
Thanks,
Justin
|
|
|
|
|
A quick work around will be a way to format the input from the user, in your case, the address, into an appropriate Uri format so your class can be created. I have written up a simple formatting method that will allow you to accept different formats as you stated above (i.e., www.google.com and google.com) and create the appropriate Uri class from it. Try the following:
private Uri FormatUri(string url)
{
Uri uri = null;
if(!url.ToLower().StartsWith("http://"))
{
uri = new Uri("http://" + url);
}
else
uri = new Uri(url);
return uri;
}
So you can use this as follows:
private void button1_Click(object sender, System.EventArgs e)
{
Uri uri = FormatUri(this.textBox1.Text);
MessageBox.Show(uri.AbsoluteUri);
}
HTH
- Nick Parker My Blog | My Articles
|
|
|
|
|
While I find it odd that you don't know what server responded to you when you, in fact, made the request (a la HttpWebRequest ), you must have some valid reason.
This is possible. Pass HttpWebResponse.Server to Dns.Resolve or similar (like Dns.GetHostByName ) and you can get the IP address. If all you wanted was the name, the Server property would return that for you, as it is clearly documented.
The Dns class would not - and should not - return the protocol scheme "http". DNS - or Domain Name Service - only deals with IP<->hostname mapping. A protocol scheme merely indicates to clients what protocol to use to communicate with the server and, more often than note, the default port (HTTP's default port is 80; SMTP's default port is 25; etc.).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi...
Can anyone tell me if it is possible to run/create a C# application on Linux?
I want to know if it can run on MandrakeLinux...!
Thanks...!
QzRz
|
|
|
|
|
Yes. Take a look at Mono[^]
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Thanks...!
You just saved me for a lot of translation from C# to c++
Thanks again..!
QzRz
|
|
|
|
|
Hello,
I am having trouble updating to a database using a dataset. My code is listed below with the error description. I hope you can help me.
cnnTeacher.Open();<br />
<br />
dsTeacher.Clear();
DataRow drUpdateTeacher;<br />
<br />
daTeacher = new OleDbDataAdapter("SELECT * FROM Teacher",cnnTeacher);<br />
OleDbCommandBuilder cbTeacher = new OleDbCommandBuilder(daTeacher);<br />
daTeacher.FillSchema(dsTeacher, SchemaType.Source, "Teacher");<br />
<br />
drUpdateTeacher = dsTeacher.Tables["Teacher"].Rows.Find(txtTeacherID.Text);
drUpdateTeacher["TeacherID"] = txtTeacherID.Text;
drUpdateTeacher["FirstName"] = txtFirstName.Text;<br />
drUpdateTeacher["LastName"] = txtLastName.Text;<br />
drUpdateTeacher["Email"] = txtEmail.Text;<br />
<br />
daTeacher.Update(dsTeacher,"Teacher");
Error description - SystemNullReferenceException: Object reference not set to a instance of an object
Many thanks in advance,
Steve
|
|
|
|
|
Hello,
I think it is because you don't initialize your drUpdateTeacher object.
Try to do :
daTeacher.FillSchema(dsTeacher, SchemaType.Source, "Teacher");
//Code to add
drUpdateTeacher = dsTeacher.Tables["Teacher"].NewRow();
drUpdateTeacher = dsTeacher.Tables["Teacher"].Rows.Find(txtTeacherID.Text);//Find the row to update
This would be my first guess.
Anyways, most of the time, this error message indicates that you did not initialize an object before you used it.
Hope this helps
|
|
|
|
|
Hello,
Thanks for yourr reply.
But won't the NewRow() add a new record to the table. I was trying to update an existing row not add a new one to the table.
Many thanks in advance,
Steve
|
|
|
|
|
Hello,
No, the NewRow() function does not add a line to the existing table, it creates a line from the row without adding it to the table (it creates the column as they are in the table)
The function DataTable.ImportRow(DataRow row) is the one that adds the line.
You have to create the row with the NewRow function because otherwise, the compiler won't be able to know how many columns there is in the table, what are the columns name/index, etc.
When you create your DataRow object, it has a null value until you write the
row = DataTable.NewRow() statement.
Hope this helps!
Hugo Migneron
|
|
|
|
|
Hello,
I want to add a Splash Screen to my Smart Device Application. The situation is as follows:
The Form1.cs is my Login Page, the Splash.cs is my Form which should displayed about 3 seconds and then should automatically go on to the MainMenu Form.
To reach that I made the following:
In the Form1.cs exists a button which forwards to the MainMenu with these two lines:
MainMenu mainMenu = new MainMenu();
mainMenu.Show();
In the Constructor of the MainMenu Form I wrote after the InitializeComponent() the following lines:
Splash splash = new Splash();
splash.Show();
And in the Splash.cs I import the following method:
[DllImport("coredll.dll", CharSet=CharSet.Unicode)]
public static extern void Sleep (int dwMilliseconds);
public const int IDC_WAIT = 32514;
public const int IDC_ARROW = 32512;
public const int IDC_IBEAM = 32513;
public const int IDC_CROSS = 32515;
public const int IDC_UPARROW = 32516;
public const int IDC_NO = 32648;
public const int IDC_HELP = 32651;
private System.Windows.Forms.Label label1;
public const int IDC_HAND = 32649;
and in the Splash_Load method I wrote the following:
Sleep(3000);
this.Close();
Unfortunately this does not work correctly. Does anybody know what went wrong??
Best Regards
mat
|
|
|
|
|
Instead of pInvoking Sleep, why not use the Sleep method build into .NET
See MSDN's library reference for Thread.Sleep[^] for details
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
On top of what Colin said, the Sleep should not go into the Splash screen. Instead, the code should go into your Main form, using something like:
splash.Show();
Sleep(3000);
splash.Close()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|