|
|
Hai friends am in new this codeproject i need one doubt in C# how to create and maintain the Wep config file give me a good knowledge in web config file ? any one help me
|
|
|
|
|
|
in your web project, right click, go to Add New Item and select Web Configuration File.
Calin
|
|
|
|
|
Web.config file is used for Web Application such ASP.NET application but if you are working on Windows Forms Application you can use app.config file.
How to add Web.config file[^]
How to Add App.config file[^]
If you are using Visual Studio then right click the Project ->Add New Item->Select Web Configuration File for web.config or Application Configuration File for app.config.
|
|
|
|
|
Hello,
I would create a xml file from txt, i make this :
<br />
XDocument doc = new XDocument(<br />
new XDeclaration("1.0", "utf-8", "yes"),<br />
new XComment("Liste des clients"));<br />
while ((s = sr.ReadLine()) != null)<br />
{<br />
String[] tbStr = s.Split(new Char[] { ';' });<br />
<br />
<br />
<br />
new XElement("clients", new XElement("client", new XAttribute("ID", tbStr[0]),<br />
new XElement("société", tbStr[1]), <br />
new XElement("site", tbStr[2])));<br />
<br />
}<br />
doc.Save(@"C:\Documents and Settings\Administrateur\Bureau\output\test.xml");<br />
}<br />
<br />
<br />
unfortunately, they are an exception : Token EndDocument in state Document would result in an invalid XML document. help me to construct the xml file, thank you verry mutch.
|
|
|
|
|
please see the other post
Calin
|
|
|
|
|
Hello,
I would create a xml file from txt, i make this :
<br />
XDocument doc = new XDocument(<br />
new XDeclaration("1.0", "utf-8", "yes"),<br />
new XComment("Liste des clients"));<br />
while ((s = sr.ReadLine()) != null)<br />
{<br />
String[] tbStr = s.Split(new Char[] { ';' });<br />
<br />
<br />
<br />
new XElement("clients", new XElement("client", new XAttribute("ID", tbStr[0]),<br />
new XElement("société", tbStr[1]), <br />
new XElement("site", tbStr[2])));<br />
<br />
}<br />
doc.Save(@"C:\Documents and Settings\Administrateur\Bureau\output\test.xml");<br />
}<br />
<br />
<br />
unfortunately, they are an exception : Token EndDocument in state Document would result in an invalid XML document. help me to construct the xml file, thank you verry mutch.
|
|
|
|
|
I think you are getting this error because you are not adding a root element.
Calin
|
|
|
|
|
so I suggest you to add a ROOT element and after that add the elements in foreach.
Calin
|
|
|
|
|
can you show me, how we can do that? thank you verry mutch.
|
|
|
|
|
Can you give us the structure of the text file that you would like to convert?
|
|
|
|
|
|
See this[^] document.
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
If you are trying to say/ask something, please type it. No one will dare download the document for security reasons
|
|
|
|
|
I wouldn't go as far as to say no one
|
|
|
|
|
Make sure you have the project set to create an XML documentation file (project properties, build tab, and check the "XML documentation file" checkbox).
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Check the "create XML documentation file" and provide a path for the docu file in the project settings.
Copy your dll and the docu xml together to your other project.
-^-^-^-^-^-^-^-
planetgeek.ch
|
|
|
|
|
Hello,
I have username and password va;ues with me. I want to check programmatically whether the username & password are correct to login to reporting services or not. Is there any way to check it from c#?
Thanks,
Ajit
|
|
|
|
|
|
i'm trying to pass values to db through a query.this ia the update query.
" UPDATE T_PRECORD
set PR_FIELD10= @singhalaname ,PR_FIELD8 =@singhaladesignation
where PR_FIELD21 = @regno";
i used
command.Parameters.Add("PR_FIELD10", SqlDbType.VarChar);
command.Parameters.Add("PR_FIELD8", SqlDbType.VarChar);
command.Parameters.Add("PR_FIELD21", SqlDbType.VarChar);
command.Parameters["PR_FIELD10"].Value = cadbn.Name_singhala;
command.Parameters["PR_FIELD8"].Value = cadbn.Desig_sinhala;
command.Parameters["PR_FIELD21"].Value = cadbn.Regno;
but when i execute this i get the exception saying that to declare the
@singhalaname,@singhaladesignation, @regno
can anyone tell me how to pass vales as parameters to sql 2000 DB
|
|
|
|
|
when you add params you need to type the param name not the fieldname
that maybe the problem
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
How about this ?
command.Parameters.Add("@singhalaname", SqlDbType.VarChar);<br />
command.Parameters.Add("@singhaladesignation", SqlDbType.VarChar);<br />
command.Parameters.Add("@regno", SqlDbType.VarChar);<br />
ommand.Parameters["@singhalaname"].Value = cadbn.Name_singhala;<br />
command.Parameters["@singhaladesignation"].Value = cadbn.Desig_sinhala;<br />
command.Parameters["@regno"].Value = cadbn.Regno;
|
|
|
|
|
thanks , but i still getting the same exception? any other idea?
|
|
|
|
|
How are you executing the query ? Can you paste the code/error for better understanding ?
Make sure,
column names PR_FIELD10,PR_FIELD8,PR_FIELD21 do exists in the table and there is no typo
All your datatypes are varchar ?
Try doing it with this string,
string updateQuery = <br />
" UPDATE T_PRECORD <br />
set PR_FIELD10= '" + cadbn.Name_singhala + "' ,PR_FIELD8 = '" + cadbn.Desig_sinhala + "' where PR_FIELD21 = '" cadbn.Regno "'";
Edit - Also, make sure you are updating the right columns
|
|
|
|