15,891,136 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 Mike988 (Top 34 by date)
Mike988
11-Oct-12 14:40pm
View
Thank you
Mike988
5-Sep-12 13:06pm
View
Thank you so much. it works.
Thanks again
Mike988
4-Sep-12 21:44pm
View
it doesn't matter because it's for school and all free
Mike988
4-Sep-12 21:40pm
View
I have learned both. I don't have much experiences with php but I studied asp.net more
Mike988
4-Apr-12 14:34pm
View
it's first time i use classes in asp.net
my code work with this code without classes.but the teacher want to use classes
I have trouble how to use the class and call it from my entire site , instead of my old code.
SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyLocal"].ConnectionString);
//Make the connection
Conn.Open();
//Define you query
string sql = "SELECT * FROM Customer Order by LastName, FirstName";
//Declare a SQL Adapter
SqlDataAdapter da = new SqlDataAdapter(sql, Conn);
//Declare a DataTable
DataTable dt = new DataTable();
//Populate the DataTable
da.Fill(dt);
//Bind the Listview
lv.DataSource = dt;
lv.DataBind();
dt.Dispose();
da.Dispose();
Conn.Close();
Mike988
4-Apr-12 13:56pm
View
Deleted
how can i do that, i am new in c#
Mike988
29-Mar-12 10:14am
View
thank you so much
Mike988
29-Mar-12 10:05am
View
Thank you so much .i did this but how can i recall it from the page , it's first time i use wrapper.
Mike988
22-Mar-12 7:58am
View
this is the connection . MySQLConnector.txt
//I have a few radio buttons to update before that code and they works fine.
if ($_SESSION['CustomerID']==0) { // Not logged in
$_SESSION['Message'] = "Insert Preferences: Permission Denied";
header("Location: index.php") ;
} else {
include "MySQLConnector.txt";
}
Mike988
22-Mar-12 7:32am
View
i put the rest of my code
Mike988
21-Mar-12 12:43pm
View
string sql = ("SELECT * FROM Customer WHERE (FirstName LIKE \'%" + (txtSearch.Text + "%\')"));
Mike988
21-Mar-12 12:43pm
View
Thank you so much
Mike988
21-Mar-12 12:41pm
View
i tried it with out {} and it didn't work.
string sql =string.Format("SELECT * FROM Customer, WHERE FirstName LIKE '%txtSearch.text%'");
this code worked for me .
string sql = ("SELECT * FROM Customer WHERE (FirstName LIKE \'%" + (txtSearch.Text + "%\')"));
Mike988
21-Mar-12 12:01pm
View
Thanks for your response ,
i tried like that.
string sql =string.Format("SELECT * FROM Customer, WHERE FirstName LIKE '%{txtSearch.text}%'");
but it gives me error.
Mike988
21-Mar-12 10:45am
View
it works now , i just make it ddlCategoryID.Items.Add(liC); instead of ddlCategoryID.Items.Add(liC.text);
Thank you so much.
Mike988
21-Mar-12 10:19am
View
Deleted
try to edit the 2nd product (aaaaa) and you will see the error I keep getting, and the category doesn't match
Mike988
21-Mar-12 10:14am
View
Deleted
http://itd1.cincinnatistate.edu/ASPnet_shakerbadrm/Products.aspx
i uploaded the code.
Mike988
21-Mar-12 10:11am
View
after commented that line
when i click edit user , it doesn't select the category.
Mike988
21-Mar-12 10:09am
View
it's int
Mike988
21-Mar-12 9:59am
View
i post it up, thank you so much for your help
Mike988
21-Mar-12 8:40am
View
is that the right way to do it, i tried your code but still gives me same error
ddlCategoryID.SelectedValue = drP["CategoryID"].ToString();
ddlCategoryID.SelectedItem.Text = drP["Description"].ToString();
ddlVendorID.SelectedValue = drP["VendorID"].ToString();
ddlVendorID.SelectedItem.Text = drP["VendorName"].ToString();
Mike988
21-Mar-12 8:39am
View
it gives me , this error Input string was not in a correct format.
may be my populating is wrong ?
ddlCategoryID.SelectedValue = drP["CategoryID"].ToString();
ddlCategoryID.SelectedItem.Text = drP["Description"].ToString();
ddlVendorID.SelectedValue = drP["VendorID"].ToString();
ddlVendorID.SelectedItem.Text = drP["VendorName"].ToString();
Mike988
21-Mar-12 8:21am
View
for new user /
//Loop through the DataReader
ddlCategoryID.Items.Clear();
while (drC.Read())
{
ListItem liC = new ListItem();
liC.Text = drC["Description"].ToString();
liC.Value = drC["CategoryID"].ToString();
ddlCategoryID.Items.Add(liC.Text);
}
drC.Close();
ConnC.Close();
// to open existing user
ddlCategoryID.SelectedItem.Text = drP["Description"].ToString();
ddlCategoryID.SelectedItem.Value = drP["CategoryID"].ToString();
Mike988
10-Mar-12 7:38am
View
i tested each code by it self. i found the update code work fine , but when i put the code before it , it make it stop, i updated my code.
i am trying to find out what is wrong with the first code (Populate the data)
Mike988
9-Mar-12 12:24pm
View
I am new in C# , I Put a breakpoint on cmd.ExecuteNonQuery and (start debuging) and immediate window but it tell me.,
The expression cannot be evaluated while in run mode.
i am sorry
Mike988
9-Mar-12 11:53am
View
every time i select different row the id change. and it match the id in the database.
Mike988
9-Mar-12 11:46am
View
I really appreciate that you trying to help me. i been struggling in this h.w assignment for couple days.
Mike988
9-Mar-12 11:45am
View
it's like that
http://localhost:15110/Project2/CustomerEdit.aspx?MODE=E&id=1000
Mike988
9-Mar-12 11:43am
View
i did edited like that, but still doesn't work.
<pre lang="c#">
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (Request.QueryString["id"] != null)
{
int CustomerID = Convert.ToInt32(Request.QueryString["id"]);
//Declare the connection object
SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyLocal"].ConnectionString);
//Make the connection
Conn.Open();
string sql = "UPDATE [Customer] SET [FirstName] = @FirstName, [LastName] = @LastName, [Email] = @Email, [Password] = @Password, [Address1] = @Address1, [Address2] = @Address2, [City] = @City, [State] = @State, [zip] = @zip, [Phone] = @Phone, [Fax] = @Fax WHERE CustomerID=@CustomerID";
//Declare the Command
SqlCommand cmd = new SqlCommand(sql, Conn);
//Add the parameters needed for the SQL query
cmd.Parameters.AddWithValue("@CustomerID", CustomerID);
cmd.Parameters.AddWithValue("@FirstName", txtFirstName.Text);
cmd.Parameters.AddWithValue("@LastName", txtLastName.Text);
cmd.Parameters.AddWithValue("@Email", txtEmailA.Text);
cmd.Parameters.AddWithValue("@Password", txtPasswordA.Text);
cmd.Parameters.AddWithValue("@Address1", txtAddress1.Text);
cmd.Parameters.AddWithValue("@Address2", txtAddress2.Text);
cmd.Parameters.AddWithValue("@City", txtCity.Text);
cmd.Parameters.AddWithValue("@State", txtState.Text);
cmd.Parameters.AddWithValue("@Zip", txtZip.Text);
cmd.Parameters.AddWithValue("@Phone", txtPhone.Text);
cmd.Parameters.AddWithValue("@Fax", txtFax.Text);
//Execute the query
cmd.ExecuteNonQuery();
Conn.Close();
Response.Redirect("Customers.aspx");
}
</pre>
Mike988
9-Mar-12 11:39am
View
like that or ? int CustomerID = Convert.ToInt32(Request.QueryString["id"]);
Mike988
9-Mar-12 11:37am
View
i updated .
CustomerID = Request.QueryString["id"];
how can i convert the querystring to int. i think that is might be the problem.
Mike988
9-Mar-12 11:31am
View
http://localhost:15110/Project2/CustomerEdit.aspx?MODE=E&id=1000
yeah and when the page load i did this statmenet.
CustomerID = Request.QueryString["id"];
Label1.Text = CustomerID;
and it shows the id number correct on the label.
i also tried to set the customerID when to this label.
cmd.Parameters.AddWithValue("@CustomerID", Label1.Text);
Mike988
9-Mar-12 11:19am
View
Do you know how i setting customerID to make it work,
i tried to put CustomerID = Request.QueryString["id"];
but it still doesn't work
Mike988
9-Mar-12 11:13am
View
this is my problem . the customerID is equal to querystring id.
CustomerID = Request.QueryString["id"];
Show More