15,908,111 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by AhmedHosny96 (Top 22 by date)
AhmedHosny96
28-Dec-18 12:51pm
View
yeah here is my login.aspx page behind code
string s = ConfigurationManager.ConnectionStrings["RegistrationConnectionString2"].ConnectionString;
protected void LoginButton_Click1(object sender, EventArgs e)
{
if (Page.IsValid)
{
using (SqlConnection con = new SqlConnection(s))
{
SqlCommand cmd = new SqlCommand("spUserlogin", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@username", TextBoxUsername.Text);
cmd.Parameters.AddWithValue("@password", TextBoxPassword.Text);
SqlCommand cmd1 = new SqlCommand("spAdminlogin");
cmd1.CommandType = CommandType.StoredProcedure;
try
{
con.Open();
int value = (int)cmd.ExecuteScalar();
if (value == 1)
{
if (CheckBox1.Checked)
{
HttpCookie user = new HttpCookie("user_cookies"); //creating cookie object where user_cookies is cookie name
user["New"] = TextBoxUsername.Text; // cookie content
user.Expires = DateTime.Now.AddYears(3); // give the time/duration of cookie
Response.Cookies.Add(user); // it gives the response in browser
}
else
{
Session["New"] = TextBoxUsername.Text;
}
Response.Redirect("home.aspx");
}
else
{
Label_Login.Visible = true;
Label_Login.Text = "Use Correct username and password";
}
}
catch (Exception ex)
{
labelError.Visible = true;
labelError.Text = "Something went wrong! Contact your devloper " + ex.Message;
}
}
}
}
}
AhmedHosny96
17-Dec-18 15:10pm
View
thank u brother for every thing i have solved the error by generating the result in different way thanks for your help again <3 big hug
AhmedHosny96
17-Dec-18 2:52am
View
i will recommend python
AhmedHosny96
15-Dec-18 10:48am
View
@Richard Deeming still the issue remains unsolved what did u recommend..?
AhmedHosny96
14-Dec-18 15:51pm
View
sorry the problem starts from :
if (radioButton.Text == answer)
{
correctAnswers++;
totalMarks += marks;
}
else
{
incorrectAnswers++;
radioButton.Checked = false;
}
and stop until here
else if (radioButton.Text == answer)
{
correctAnswers++;
radioButton.Checked = true;
}
so what should i do .. ?
AhmedHosny96
14-Dec-18 15:38pm
View
bro i debugged the code starting from the exasubmit_click
the rest of the code is ok but the debugger jumped for :
if (radioButton.Checked)
{
if (radioButton.Text == answer)
{
correctAnswers++;
totalMarks += marks;
}
else
{
incorrectAnswers++;
radioButton.Checked = false;
}
}
to :
else if (radioButton.Text == answer)
{
correctAnswers++;
radioButton.Checked = true;
}
so its clear that the conditionals are not executed by the compiled ... ?
AhmedHosny96
14-Dec-18 15:12pm
View
its showing : percentage is 0.00% (0/42)
and i checked the IsPostBack property but nothing changed ?
AhmedHosny96
14-Dec-18 14:49pm
View
still its 00.0% i think its not incrementing the correct answers ?
AhmedHosny96
14-Dec-18 14:43pm
View
ok please what is the solution after following yours and #Griffs solution its still showing 0.0%
AhmedHosny96
14-Dec-18 14:38pm
View
i mean its still displaying 0.00% after changing to double
AhmedHosny96
14-Dec-18 14:36pm
View
ok sorry for this bro <3
AhmedHosny96
14-Dec-18 14:28pm
View
brother iam frustrated at this topic i have done all the tips u have given but nothing is working help me please...?
AhmedHosny96
14-Dec-18 14:26pm
View
@OriginalGriff bro still its displaying 0.00% ..?
AhmedHosny96
12-Dec-18 13:53pm
View
after changing int to double but its not working bro ?
AhmedHosny96
12-Dec-18 3:28am
View
thank you so much brother
AhmedHosny96
7-Dec-18 11:43am
View
even if i do not use the table mark-up its not still displaying
AhmedHosny96
7-Dec-18 11:08am
View
Thank you soo much brother big hugs.... this tip helped me
AhmedHosny96
7-Dec-18 8:38am
View
sorry to ask you this but i want to change this datalist into gridview so can you please help?
AhmedHosny96
6-Dec-18 8:27am
View
thank you so much brother
1st its a data-list not grid-view but i named it as a Question-grid
2nd i have four radio buttons can u please tell me how to do it for the other three radio buttons
AhmedHosny96
6-Dec-18 8:19am
View
Deleted
thank you so much brother
but i have four radio buttons can u please tell me how to do it for the other three radio buttons
AhmedHosny96
5-Dec-18 10:26am
View
yes brother my table here is biology i need to compare all the 4 radiobuttons with correct answer in the database and then display the result ?
AhmedHosny96
29-Nov-18 13:29pm
View
brother i can show u my code behind but what i want is to calculate the result and display the percentage help me please ? thanks in advance <3
protected void Page_Load(object sender, EventArgs e)
{
//To View Option Selected
SqlDataAdapter da1 = new SqlDataAdapter("SELECT Option" + dt.Rows[0]["Opt_Selected"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[0]["Que_Id"].ToString(), con);
DataTable dt1 = new DataTable();
da1.Fill(dt1);
Label2.Text = dt1.Rows[0]["Option" + dt.Rows[0]["Opt_Selected"].ToString()].ToString();
SqlDataAdapter da2 = new SqlDataAdapter("SELECT Option" + dt.Rows[1]["Opt_Selected"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[1]["Que_Id"].ToString(), con);
DataTable dt2 = new DataTable();
da2.Fill(dt2);
Label5.Text = dt2.Rows[0]["Option" + dt.Rows[1]["Opt_Selected"].ToString()].ToString();
SqlDataAdapter da3 = new SqlDataAdapter("SELECT Option" + dt.Rows[2]["Opt_Selected"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[2]["Que_Id"].ToString(), con);
DataTable dt3 = new DataTable();
da3.Fill(dt3);
Label8.Text = dt3.Rows[0]["Option" + dt.Rows[2]["Opt_Selected"].ToString()].ToString();
SqlDataAdapter da4 = new SqlDataAdapter("SELECT Option" + dt.Rows[3]["Opt_Selected"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[3]["Que_Id"].ToString(), con);
DataTable dt4 = new DataTable();
da4.Fill(dt4);
Label11.Text = dt4.Rows[0]["Option" + dt.Rows[3]["Opt_Selected"].ToString()].ToString();
//To View Right Answer Of The Question
SqlDataAdapter da21 = new SqlDataAdapter("SELECT Option" + dt.Rows[0]["Ans"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[0]["Que_Id"].ToString(), con);
DataTable dt21 = new DataTable();
da21.Fill(dt21);
Label3.Text = dt21.Rows[0]["Option" + dt.Rows[0]["Ans"].ToString()].ToString();
SqlDataAdapter da22 = new SqlDataAdapter("SELECT Option" + dt.Rows[1]["Ans"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[1]["Que_Id"].ToString(), con);
DataTable dt22 = new DataTable();
da22.Fill(dt22);
Label6.Text = dt22.Rows[0]["Option" + dt.Rows[1]["Ans"].ToString()].ToString();
SqlDataAdapter da23 = new SqlDataAdapter("SELECT Option" + dt.Rows[2]["Ans"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[2]["Que_Id"].ToString(), con);
DataTable dt23 = new DataTable();
da23.Fill(dt23);
Label9.Text = dt23.Rows[0]["Option" + dt.Rows[2]["Ans"].ToString()].ToString();
SqlDataAdapter da24 = new SqlDataAdapter("SELECT Option" + dt.Rows[3]["Ans"].ToString() + " FROM " + sub + " WHERE Id=" + dt.Rows[3]["Que_Id"].ToString(), con);
DataTable dt24 = new DataTable();
da24.Fill(dt24);
Label12.Text = dt24.Rows[0]["Option" + dt.Rows[3]["Ans"].ToString()].ToString();
}
Show More