« first day (1287 days earlier)      last day (3652 days later) » 

2:22 AM
can somebody help me with my problem?
http://stackoverflow.com/questions/23213450/compare-tables-using-linq
 
 
4 hours later…
6:49 AM
0
Q: Appending dropdown menu to specific menuitem in Kendo UI

Angry TigerI have created menubar in kendo UI as follows @Html.Kendo().Menu().Name("NavigationMenu").Items(items => { if (Request.IsAuthenticated) { foreach (SearchHub.Models.Shared.SubModule s in ViewBag.SubModule) { items...

 
7:04 AM
Anyone here.... pls help me
I am just trying to create an XML file in C#
class MainClass
{
private XmlDocument doc;
private const string PATH = @"C:/inetpub/wwwroot/jj/jj/zzzXML.xml";

public void Register(string regName, string regHousingUnit, string regUsername, string regPassword)
        {
            doc = new XmlDocument();
            if (!File.Exists(PATH))
            {
                //Create neccessary nodes
                XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
                XmlComment comment = doc.CreateComment("This is an XML file for User Registration");
I am getting -- Cannot set a value on node type 'Element'. in the above specified line. Can anyone pls help me>
 
7:26 AM
@Illaya A different approach can be found in tech.pro/tutorial/798/csharp-tutorial-xml-serialization
 
@RoelvanUden can you pls tell me without MVC
 
That is without MVC.
 
just take look on this. this is same as my exact need
 
I can only advice you to use a normal approach, serialization/deserialization
 
I think the link you were given is very wage
 
7:43 AM
@Illaya hi\
 
@Shift hi
 
housingunit.InnerText
username.InnerText
password.InnerText
 
Error 1 'string' does not contain a definition for 'InnerText' and no extension method 'InnerText' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?) C:\inetpub\wwwroot\jj\jj\MainClass.cs 59 52 jj
 
housingunit.InnerText = "TEST";
i dont get any error
 
name.Value = regName;
                housingunit.InnerText = regHousingUnit;
                username.InnerText = regUsername;
                password.InnerText = regPassword;
correct?
 
7:48 AM
yeah
 
The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.
in line
 
maybe you are passing wring type of data to the nodes
 
doc.AppendChild(declaration);
doc.AppendChild(comment);
doc.AppendChild(users);
users.AppendChild(user);
user.AppendChild(name); <-- here
user.AppendChild(housingunit);
user.AppendChild(username);
user.AppendChild(password);

//Save the document
doc.Save(PATH);
this is my full code
 
sec
 
class MainClass
    {
        private XmlDocument doc;
        private const string PATH = @"C:/inetpub/wwwroot/jj/jj/zzzXML.xml";
public void Register(string regName, string regHousingUnit, string regUsername, string regPassword)
        {
//Create an xml document
            doc = new XmlDocument();
            //If there is no current file, then create a new one
            if (!File.Exists(PATH))
            {
                //Create neccessary nodes
                XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
am I doing correct?
 
7:53 AM
one moment
 
ok
 
user1804599
Only one?
 
hehe
why
i am checking it out
if (!File.Exists(PATH))
{
//Create neccessary nodes
XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
XmlComment comment = doc.CreateComment("This is an XML file for User Registration");
XmlElement users = doc.CreateElement("Users");
XmlElement user = doc.CreateElement("User");

XmlElement housingunit = doc.CreateElement("housingunit");
XmlElement username = doc.CreateElement("username");
XmlElement password = doc.CreateElement("password");

// Adding attribute to user element
can you try this
//Create neccessary nodes
XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
XmlComment comment = doc.CreateComment("This is an XML file for User Registration");
XmlElement users = doc.CreateElement("Users");
XmlElement user = doc.CreateElement("User");

XmlElement housingunit = doc.CreateElement("housingunit");
XmlElement username = doc.CreateElement("username");
XmlElement password = doc.CreateElement("password");

// Adding attribute to user element
user.SetAttribute("name", regName);
 
just a moment
 
<?xml version="1.0" encoding="UTF-8" standalone="true"?>

<!--This is an XML file for User Registration-->

-<Users>


-<User name="JOHN">

<housingunit> </housingunit>

<username>UNAME</username>

<password>PASS</password>

</User>

</Users>
is created
 
8:01 AM
yes. but
I need like this
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<!--This is an XML file for User Registration-->
<Users>
<User>
<name>illaya</name> <-- change here
<housingunit></housingunit>
<username>UNAME</username>
<password>PASS</password>
</User>
</Users>
 
ok
 
may I change this line
XmlAttribute name = doc.CreateAttribute("name");
to
XmlElement name = doc.CreateElement("name");
?
@Shift
 
hello Everyone
I'm new C# development and stuck at one place. Please help me
 
//Create neccessary nodes
XmlDeclaration declaration = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
XmlComment comment = doc.CreateComment("This is an XML file for User Registration");

XmlElement users = doc.CreateElement("Users");
XmlElement user = doc.CreateElement("User");
XmlElement name = doc.CreateElement("name");
XmlElement housingunit = doc.CreateElement("housingunit");
XmlElement username = doc.CreateElement("username");
XmlElement password = doc.CreateElement("password");

// Adding attribute to user element
bug
change users.AppendChild(name); to user.AppendChild(name);
@Prakash Can you move your leg?
 
I have a form in which I have a resizable GroupBox. on run time, dynamic data is added to groupbox and hence the form become scrollable..
now I want to print the whole details but it prints only one page..

here what I did :
printForm1.Print(this, Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.PrintOption.Scrollable);
 
8:08 AM
also please remove // Adding attribute to user element
user.SetAttribute("name", "JOHN");
hehe
that was for test purposes
@Prakash you mean printing on a printer?
 
it print the area which is not visible on form but only one PAge.. if there is more data, only one page data is printing and remaining is not
Yes
@Shift yes
 
@Shift thank you so much. Its working now!!!!!!!!11
 
I want to print it on printer
I didn't tried on live printer.. I tried on preview
 
@Illaya no problem
 
and only one page preview is comming
 
8:12 AM
@Prakash you need to use HasMorePage
 
how to do that.. please tell me
 
well
its not just a one line of code to able to print multiple pages
you need to count lines
 
ohh
 
and check the paper sizes
if its going over then create new pages
check this tutorial
 
but the above line is printing one page efficiently..
 
8:14 AM
one page is easy
multiple is more work
 
Oh
ok
give me the link for tutotial
 
let me try
this
but I want to print the form not document from some location
this method :

private void ReadFile()
{
string docName = "testPage.txt";
string docPath = @"c:\";
printDocument1.DocumentName = docName;
using (FileStream stream = new FileStream(docPath + docName, FileMode.Open))
using (StreamReader reader = new StreamReader(stream))
{
stringToPrint = reader.ReadToEnd();
}
}
reffering to some document in C:/ drive and print that docuemnt
I want to print the data which I have in GroupBox
 
printing a Windowsform is not a neat solution
you want the data be printed
 
Didn't get you
 
8:23 AM
when you print form you see also the form elements?
 
no...
sorry
Yes
Button are being printed
 
thats what I mean
thats not a nice way to print
you want the data
not the buttons on paper
 
so If I use the code in above link, it will print what I want?
 
I think you cannot print a form that exceeds the paper height
 
I mean the form data
 
8:25 AM
it's difficult to maintain height etc
well
you can put the data in a collection
while printing loop the collection
 
ok
then
 
and generate pages
 
Ok
ok
 
than print it
 
I guess I got It
 
8:26 AM
if you are developing something first thing is to know how things work
copy that tutotrial
and check how it is working
there are alot of tutorials on YouTube i see
check it out
 
9:01 AM
Morning fellow bio-units
 
Hi
 
@jyrka hi
 
9:38 AM
@Shift u there?
 
y
 
need a help
 
again
what help
 
foreach (XmlNode elm in doc.SelectNodes("users/user"))  <-- error in this line "object reference not set to instance of object"
            {
                XMLusername = elm.SelectSingleNode("username").InnerText;
                XMLpassword = elm.SelectSingleNode("password").InnerText;

                if ((XMLusername == logUsername) && (XMLpassword == logPassword))
                {
                    //redirect to login page

                }
                else
                {
                    //error message
my XML
<Users>
  <User>
    <name>1</name>
    <housingunit>1</housingunit>
    <username>1</username>
    <password>1</password>
  </User>
  <user>
    <name>2</name>
    <housingunit>2</housingunit>
    <username>2</username>
    <password>2</password>
  </user>
</Users>
what is wrong in my code?
 
hmm
foundation is bad
your are looping and redirecting when needed
its weird
why do yoiu create a XML to check credentials
dont you have a database
 
9:43 AM
No. Bcz this login is for a installer type application
 
so when someoone trys to log on you loop the users xml to check if the user exists and validate the user
 
so we didnt install the necessary database in all systems. so only i am using XML
yeah
 
it not secure
the xml file is installed also on the same folder
 
s. bt this is just for credentials and dont want any security
 
one click installer?
 
9:45 AM
yeah
 
ok
wait sec
 
can you pls help me?
ok
I tried like
XmlNodeList xmlList = doc.SelectNodes("/users/user");
            foreach (XmlNode xn in xmlList)
            {
                XMLusername = xn["username"].InnerText;
                XMLpassword = xn["password"].InnerText;
            }
but no change. same error
 
Jon
is doc null?
 
you want me to help you?
 
@Shift yes
@Jon shown my mistake
yes I forget to load XML( doc is null )
 
9:56 AM
XmlNodeList nlist = doc.SelectNodes("Users/User");

foreach (XmlNode elm in nlist) // <-- error in this line "object reference not set to instance of object"
{
string XMLusername = elm.SelectSingleNode("username").InnerText;
string XMLpassword = elm.SelectSingleNode("password").InnerText;

if ((XMLusername == logUsername) && (XMLpassword == logPassword))
{
//redirect to login page

}
else
{
//error message
}
}
doc.Load("file");
 
Jon
problem solved :)
 
private const string PATH = @"C:/inetpub/wwwroot/jj/jj/zzzXML.xml";
            doc.Load(PATH);
bt getting same error in this line "object reference not set to instance of object"
 
Jon
doc is still null
 
I have that XML file in that location
 
Jon
doc = new XMLFile() or what not
you still need to init your object
 
10:04 AM
        XmlDocument doc = new XmlDocument();
 
yes
but the process does not enter into the foreach loop
 
it is case sensitive
Users/User");
not users/user
 
yes correct. thanks. now working.
 
your welcome
 
@Shift may I know, where are you from?
Netherlands
 
10:09 AM
I live in Holland but I am Turkish :)
you?
 
I am from India?
 
ok nice
 
know india?
 
yeah
never been there
 
came here?
 
10:10 AM
but i know india
 
what do you know about india?
 
Jon
LOL
 
haha
where it is on the map
 
@Jon what?
 
10:11 AM
@Shift good joke.........
 
hehe
tac mahal
mosk
 
Jon
outsourcing
 
also
IT support paradise
 
Jon
strong math
 
smart people
 
Jon
10:13 AM
royalty / peasants
 
enough
 
haha
holy cow
 
but sorry to say I dont know anything ur country
 
google is your friend
 
@Jon u from Canada?
 
Jon
10:15 AM
Aye.
 
@Shift but I know onething. u have new cricket team. bcz i am cricket fan. so only i know this
@Jon u know, my aim is to come Canada
 
Jon
You can come live here and work for me for free until you get settled
 
@Jon hmmm.. sure. I'll work for you, If i get a chance to come there..
 
Jon
lol, i didn't expect you to accept this offer
Its a nice country, but damnit, we got snow last night.. and i'm annoyed
its almost May for crying out loud
 
Bcz I am ready to work there. but I dont have any resource to come there.
 
Jon
10:20 AM
Yeah, I have no idea how the immigration process works.
 
that doesn't matter I can adopt anywhere at any situation
 
Jon
I think you only get to stay so long, if you are not citizen
So you'd have to get married within a year to stay
 
oh.... I am just 23 years old.
then how did I marry
 
Jon
I just know that my brother married a japanese girl, she was working here for over a year, and was getting shipped out
So he married her so she could stay
her name was Yoshi... I'd of married her just for the name
 
oh ok ok
I dont any girl to marry me, but I need a job there.
so only I'l come there
 
Jon
10:23 AM
Yeah, just saying, immigrant workers have a certain period of time that they can stay
You'd need to look into it...
 
do you have any job openings? @Jon
 
Jon
I work for the government :P
 
oh great!
 
Jon
I am not in a position to hire, no
 
can you contact me if your friend's company having openings?
 
10:26 AM
hello all!
 
Jon
Probably not... I know nothing of your skills, or who you are.
 
you can interview me
 
Jon
You realize how difficult it would be to get your foot in the door in a company in canada, when living in india?
There is a lot of unemployed people here
 
oh itz ok
 
Jon
Wouldn't it be funny that you would get a job here in canada.. and then they eventually outsourced it to india?
Oh... good news everyone:
Google points gun to your head SOCIALIZE!!!!
 
10:31 AM
Ok @Jon leave it. I'll remain in India
 
Jon
@Illaya Don't give up your dream... I'm just saying it will be difficult to achieve, but it is possible
I'd also suggest Ottawa
Large diversity of cultures there, you'd fit right in
 
hmm. thanks
 
Jon
And Ottawa is awesome.
Nice clean city.
If you like a more dirty, higher crime area.. try Toronto
 
no no
 
Jon
And if you like nature, go to BC
My brother is in Whistler -- its so beautiful out there
 
10:35 AM
bc mean?
 
Jon
british columbia
 
oh ok ok
 
Jon
Rocky Mountains
 
how can i call this kind of class into another 1?
class class1
{
internal class Collection : IEnumerable<Item>
 
Suppose if you get any chance to come to India, then you must meet me
 
Jon
10:37 AM
Sure
 
hmm
 
Jon
@Elegiac what do you mean?
 
i want to call it on other class
like class1.Collection();
is that possible?
 
Jon
does that code compile?
 
yeah
my class compile
but this code doesnt:
class1.Collection();
 
Jon
10:40 AM
class1 obj = new class1();
obj.Collection
hmmm
 
doesnt work
invalid token '(' in class
 
Jon
yeah'
its
 
how does it works btw
is there a way i can call an internal class?
 
Jon
I never put a class inside of a class like that.
Yes..
 
how
 
Jon
10:43 AM
class1.Collection obj = new class1.Collection()
that Collection is a object.
 
then
i got an error @Jon
 
Jon
Yeah, because it is IEnumerable
what is the error?
What is the purpose of storing a class inside of a class?
 
class1.Collection does not contain a constructor that takes 0 arguments
 
Jon
class1.Collection<Item> obj = new class1.Collection<Item>();
I think...
 
the non-generic type 'clas1......' cannot be used with type arguments
 
Jon
10:48 AM
ok,well post your constructor please
for the Collection class.
most likely, you are just ommiting the contructor parameters
Is this your code?
Gonna get a coffee... bbs
 
Morning all! Why do you not create a object collection instead of a propertie collection: List<class1> myListObjs = new List<class1>();
It is so much easy!
@Elegiac
 
public class1(TextBoxBase textbox)
        {
            this.Textbox1 = textbox;
        }
@Jon
yow @KreversonJulho
cant be because im calling whole function not just list
public IEnumerator<AI> GetEnum()
{
   return Build().Distinct().GetEnumerator();
}
 
Jon
Yeah, that code is blowing my mind, lol
gonna need this coffee first
 
Maybe you need declare your class like that: public class1:IEnumerable<item>
{
}
 
Jon
Yeah... I don't understand why you are putting a class inside another... I don't see the reason for it
 

« first day (1287 days earlier)      last day (3652 days later) »