User Profile
Collapse
-
Yep, its text, thanks for the answer! :) -
No, but I used it as a protected string variable and it worked, will this work too?
Anyway, thanks for the reply!Leave a comment:
-
SQL query syntax for updating database asp.net c#
Hello,
Could anyone please check the basic syntax of this query and let me know if its correct? Basically I am trying to update the email Id of a user whose username is contained within the variable 'userName' and the new Email is within 'NewEmail'.
Code:string cmdText = "UPDATE Users SET EmailId ='" + NewEmail + "' WHERE UserName ='" + userName + "'";
-
Storing images in a database using asp.net and c#
I am trying to test storing images in a database, I got this code after searching on Google but it doesn't work:
Code:protected void Button1_Click(object sender, EventArgs e) { string strImageName = @"E:\images.jpg"; Bitmap bNewImage = new Bitmap(strImageName); FileStream fs = new FileStream(strImageName, FileMode.Open, FileAccess.Read); //creating
-
how to declare a protected string array in asp.net c#
Hello,
I need to declare a protected string array in my .cs file to make it accessible in the .aspx file of the same page, could anyone please let me know the syntax of declaring a protected string array in C#? -
-
how to use a variable defined in aspx.cs in an aspx file
Hello,
I have a variable in a ".cs.aspx" file and I want to use it in the same page's ".aspx" file, I tried using Reponse.Write with the help of the syntax:
Code:<%Response.Write(var)%>
-
Thank you so much, I'll read up on that.
One more question. If I use sessions, will I then have to use that session info (username in this case) to retrieve the data again from the database, is that the best way to proceed?Leave a comment:
-
How to know which user is logged in?
Hello,
I have a Login page which checks if the user has entered the correct password by comparing it with values in the database.
I have done this with two classes: one that gets the passwords from the sql database and another that compares this data with the data entered by the user.
I have another page to which I redirect the users once they have successfully logged in (inside the Login button function)....Last edited by Frinavale; Apr 27 '11, 02:33 PM. Reason: Formatted the question so that it is easier to read. -
-
How to create side-by-side boxes inside another box?
Hello,
I want to create three side-by-side boxes inside a much larger box. I have this code:
Code:<html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> <body> <div style="width:100%; "> <div id ="wrapper" > <p class="headerStyle"
-
Sorry, I should have mentioned it earlier, I declared it as a global array. Thanks for replying, my code is working now, I used vectors to declare an array and get the file data instead of the method above.Leave a comment:
-
How to read from a text file?
Hello,
I am supposed to read from a text file a series of numbers and then store them in a struct array.
Here's my code:
Code:int main() { ifstream In; string folder, filename, name2, line; int i = 0; cout << endl << "Enter the name of the folder" << endl; cout << "Follow the format: c:/your_folder_name/
-
That must be it. I tried 'do while' and now it works perfectly. Thanks a lot! :)
And thanks once again to both of you for all the replies.Leave a comment:
-
Yep, I tried that, but it just copies the second row instead of the first. However, I just replaced getline(myfile, line)) with ( !myfile.eof() ) in the while loop and this gives the right output. Is there anything wrong in the way I use getline then?Leave a comment:
-
Thanks for the replies!
There seems to be nothing wrong with the indexing since I initialized i as zero before copying the data with the code above. And in my output code I am just using a for loop going from 0 to maximum. The problem occurs somewhere in the copying.Leave a comment:
-
Why is first line of file not read in properly?
I am using this function to get data from a file
Code:void get() { string line; ifstream myfile; myfile.open ("jty.txt"); while (getline(myfile, line)) { myfile >> one[i].a >> one[i].b >> one[i].c; i++; } myfile.close(); }
-
-
How to fix error: "request for member which is of non-class type"?
Hello,
I am getting the following error
25 C:\Dev-Cpp\main.cpp request for member `no' in `one', which is of non-class type `box[12]'
in the code
Code:while (!myfile.eof()) { for(int i=0;i<12;i++) { myfile>>one.no[i]; } }
No activity results to display
Show More
Leave a comment: