16,016,204 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 .NET 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 Abdullaziz Said (Top 7 by date)
Abdullaziz Said
21-Aug-14 18:27pm
View
the same error
This webpage has a redirect loop
Abdullaziz Said
21-Aug-14 13:52pm
View
any solution or any help plz
Abdullaziz Said
20-Aug-14 22:52pm
View
string name = "";
if (Session["usernames"] != "" & Session["usernames"] != null)
{
name = Session["usernames"].ToString();
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["soom_dbConnectionString"].ConnectionString);
SqlCommand command = new SqlCommand("SELECT user_type FROM user_data where user_name='"+name+"'");
command.Connection = connection;
command.CommandType = CommandType.Text;
connection.Open();
SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
if (reader.HasRows)
{
reader.Read();
if (reader["user_type"]== "1")
{
Response.Redirect("../admincp/Default.aspx");
}
else
{
Response.Redirect("../Access_Denied.aspx");
}
}
when i use this code and iam sure that the user_type value is 1 it's redirect me to access_denied.aspx idk Why
and when i change the code to
string name = "";
if (Session["usernames"] != "" & Session["usernames"] != null)
{
name = Session["usernames"].ToString();
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["soom_dbConnectionString"].ConnectionString);
SqlCommand command = new SqlCommand("SELECT user_type FROM user_data where user_name='"+name+"'");
command.Connection = connection;
command.CommandType = CommandType.Text;
connection.Open();
SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
if (reader.HasRows)
{
reader.Read();
string type = reader["user_type"].ToString();
if (type == "1")
{
Response.Redirect("../admincp/Default.aspx");
//Response.Redirect("../Access_Denied.aspx");
}
else
{
Response.Redirect("../Access_Denied.aspx");
//Response.Redirect("../admincp/Default.aspx");
}
}
i enter infinite loop :( i hate my self i can't focus
waiting for the best answer
thanks in advance
Abdullaziz Said
24-Jul-14 16:50pm
View
thanks man i solve it
string action = Request.QueryString["action"];
string id = Request.QueryString["id"];
if (action == "state" && id != "")
{
SqlConnection cn =
new SqlConnection(ConfigurationManager.ConnectionStrings["soom_dbConnectionString"].ConnectionString);
SqlCommand cmd = new SqlCommand(
"SELECT * FROM [user_data] WHERE user_id='" + id + "'", cn);
cmd.CommandType = CommandType.Text;
cmd.Connection.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
string user_ststus = dr["user_status"].ToString();
if (user_ststus == "True")
{
SqlConnection cne = new SqlConnection(ConfigurationManager.ConnectionStrings["soom_dbConnectionString"].ConnectionString);
SqlCommand cmdz = new SqlCommand("Update [user_data] set user_status ='" + 0 + "' WHERE user_id='" + id + "';", cne);
cmdz.Connection = cne;
cmdz.CommandType = CommandType.Text;
cne.Open();
cmdz.ExecuteScalar();
cne.Close();
stat_id.Attributes["class"] = "alert alert-success";
insert_status.Text = "تم تعديل حالة العضو الي غير مفعلة !! ";
}
else if (user_ststus == "False")
{
SqlConnection cne = new SqlConnection(ConfigurationManager.ConnectionStrings["soom_dbConnectionString"].ConnectionString);
SqlCommand cmdz = new SqlCommand("Update [user_data] set user_status ='" + 1 + "' WHERE user_id='" + id + "';", cne);
cmdz.Connection = cne;
cmdz.CommandType = CommandType.Text;
cne.Open();
cmdz.ExecuteScalar();
cne.Close();
stat_id.Attributes["class"] = "alert alert-success";
insert_status.Text = "تم تعديل حالة العضو الي مفعلة !! ";
}
}
}
}
Abdullaziz Said
9-Feb-14 9:01am
View
i want to know how to create them first :)
Abdullaziz Said
8-Feb-14 12:30pm
View
yes sorry this is chrome extension changed some thing in the code
Abdullaziz Said
13-Nov-13 18:19pm
View
hello
i am sorry i can't understand this code or what this suppose to do
but the image explain more
i need to add inside the datagridview
1 combox 3 textboxs 2 of them i want to fill them with data depended on the combox selected value and the the textbox for insert new data to table in database
i hope i make good explain
sorry for english
Show More