15,909,530 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 AnoopGharu (Top 34 by date)
AnoopGharu
19-Dec-14 6:41am
View
Thank you sir for your best concern :) ,I got it now.
AnoopGharu
19-Dec-14 6:40am
View
Thank you Sir, now I got it.Can you explain me in little detail why I have to need to initialize this DateTime Property.
AnoopGharu
19-Dec-14 5:23am
View
Can you please help me what I need to write in my application to store into the database table, because I am new to ASP.Net MVC.
AnoopGharu
19-Dec-14 5:21am
View
This is the inner exception "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
AnoopGharu
19-Dec-14 5:04am
View
I check it Sir & but when I trying to update the values it again showing the same error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
AnoopGharu
28-Oct-14 5:08am
View
You are right sir,there is no issue I want to do it using the Generics List, So how it can be possible.I don't know how I need to declare the Generics List in the asp.net profile about to solving this issue.
AnoopGharu
28-Oct-14 5:04am
View
Sir I had to try all the possible way,but still unable to do it with a proper manner.Can you please give me the appropriate example or solution.
AnoopGharu
28-Oct-14 4:59am
View
Actually I am working on the simple shopping website and now I am working on the cart_page and I trying to make cart_page by using the asp.net profile.Even I already write the code to enter the one product in the profile.But if the user has to need to enter the number of products.Then the problem will be occur so that's the reason I want to use the Generics List in the profile.
Here's below is the code to enter the one product in using profile:
Web.config:-
<profile automaticSaveEnabled="false" >
<properties>
<add name="Id" type="int" allowanonymous="true">
<add name="Name" type="String" allowanonymous="true">
<add name="ImageUrl" type="String" allowanonymous="true">
<add name="Price" type="int" allowanonymous="true">
<add name="Item" type="int" allowanonymous="true">
</properties>
</profile>
This is the coding of Cart_page.
ProfileShopcart.aspx.cs:-
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
((Label)DataList1.Controls[0].FindControl("LblName")).Text = (Profile.Name).ToString();
((Image)DataList1.Controls[0].FindControl("Image1")).ImageUrl = (Profile.ImageUrl).ToString();
(((TextBox)DataList1.Controls[0].FindControl("TxtItem")).Text) = (Profile.Item).ToString();
(((Label)DataList1.Controls[0].FindControl("LblPrice")).Text) = (Profile.Price).ToString();
Profile.Save();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Profile.Name = ((Label)DataList1.Controls[0].FindControl("LblName")).Text;
Profile.ImageUrl = ((Image)DataList1.Controls[0].FindControl("Image1")).ImageUrl;
Profile.Item = int.Parse(((TextBox)DataList1.Controls[0].FindControl("TxtItem")).Text);
Profile.Price = int.Parse(((Label)DataList1.Controls[0].FindControl("LblPrice")).Text);
string ProductID = (Request.QueryString["ProductID"]);
Profile.Save();
}
}
So please help me about how to use the System.Collections.Generic.List in asp.net profile.
AnoopGharu
17-Oct-14 5:05am
View
You are right sir,but I want to store the data in asp.net profile database not into the SQL server database.
AnoopGharu
17-Oct-14 4:39am
View
Thank you sir,but I don't use any kind of query to storing the database.Can you help me please how to add the query and please give me demo, because I am new to c#.net
AnoopGharu
15-Oct-14 1:54am
View
@PawanKumar31, Still I didn't use any kind of asp.net CMS,I just trying to do it by using asp.net Profile.I want to store the cart data in asp.net profile.If you have any idea then please help me.
AnoopGharu
10-Oct-14 10:21am
View
Hello sir,I had create the following ProductsCollection class:
namespace BusinessObject
{
public class ProductsCollection:List<Products>
{
public ProductsCollection()
{
List<Products> productcollection = new List<Products>();
Products product = new Products();
product.ImageUrl = Convert.ToString("ImageUrl");
product.Name = Convert.ToString("Name");
//product.Price = Convert.ToInt32("Price");
//product.Item = Convert.ToInt32("Item");
productcollection.Add(product);
}
}
}
and on the Add_To_Cart button I did the following coding:
protected void Button1_Click(object sender, EventArgs e)
{
BusinessObject.ProductsCollection bp = new BusinessObject.ProductsCollection();
Profile.Products.Add(bp);
Profile.Save();
}
but when I run the project it shows this error "Attempting to load this property's type resulted in the following error: Could not load type 'System.Collections.Generic.List`1[BusinessObject.ProductsCollection]'.".So please help to resolve this error and even though I had did lot of googling but still didn't find the exact solution and also tell me that I declare the right properties at there or nor.So finally I update here.If you can then please give me its appropriate solution.
AnoopGharu
10-Oct-14 3:59am
View
Thank you So much Sir for your best concerned, anyway can you tell me please why you had to use "`1" in the Generic List and I have these above properties which I had already declared in the comments inside the profile.Can you tell me please how I need to define my these properties in the new PorductsCollection class with the use of Enumeration or without the use of it.Please help me because I am new to asp.net.
AnoopGharu
8-Oct-14 9:37am
View
Sir I don't know that how I need to declare the Profile provider and how I need to declare the connectionString in the profile provider to getting the values of the pre built database,even though can you tell me please how I will use List Connection for the customizing of properties.Please help me.
AnoopGharu
7-Oct-14 6:05am
View
I want to add more products into the cart_page, but it can add only one product at a time while I run the project into the browser,if I trying to add another product then it can be override the previous one which is already there.This is main problem and what's the reason,why it can be unable to keep store the more than one product.While I again restart the project the previous products are not present there.So please help me regarding this.
AnoopGharu
7-Oct-14 5:08am
View
you are right sir, I already demanding for the "Id" in the below "if(Found==false)" condition, but when I run the project in the browser then it will override the previous product and when I again trying to bring the another product.But if you have better trick rather than this one then please tell because I am new to C# asp.net.Please help me.
AnoopGharu
6-Oct-14 8:25am
View
Thank you sir for your best concern,actually these both above coding pages are TestShopcart.aspx and TestShopcart.aspx.cs pages,I forgot to mention it.Even it seems me my this "Response.Redirect("TestShopcart.aspx");" coding line is not appropriate to convert the data and even it don't come in my mind that what I need to mention there to go on the TestShopcart.aspx.cs page because in the last page where I has to getting the data by using QueryString.So it directly showing the nothing on the page and it just showing the same result.About the datatype of price and total keywords were varchar and int respectively in my database, which I had created but now I change both of them into the Int datatype.See this is the coding of TestShopcart.aspx:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataKeyNames="Id" EmptyDataText="There are no data records to display."
DataSourceID="ObjectDataSource1" >
<columns> <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True"
SortExpression="Id" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="name" />
<asp:TemplateField HeaderText="pic">
<edititemtemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("ImageUrl") %>'>
<itemtemplate>
<asp:Image ID="Image1" runat="server" Height="63px"
ImageUrl='<%# Eval("ImageUrl") %>' Width="75px" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
<asp:TemplateField HeaderText="Item">
<edititemtemplate>
<asp:TextBox ID="TextBox1" runat="server">
<itemtemplate>
<asp:TextBox ID="TextBoxCount" runat="server" Height="19px"
Text='<%#Bind ("Item") %>' Width="35px">
<asp:BoundField DataField="total" HeaderText="totalprice" />
<asp:HyperLinkField DataNavigateUrlFields="Id"
DataNavigateUrlFormatString="?DelID={0}" HeaderText="delete"
Text="delete" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetDetail"
TypeName="BusinessLogic.ProductsBL">
<SelectParameters>
<asp:QueryStringParameter Name="Id" QueryStringField="ProductId" Type="Int32" />
</SelectParameters>
<asp:Button ID="Button1" runat="server" Text="Change" onclick="Button1_Click" />
<asp:Button ID="save" runat="server" Text="Save To Database" onclick="save_Click" />
AnoopGharu
6-Oct-14 6:37am
View
You are right Sir, but here's it doesn't showing the proper result and still showing the same price which I had enter the price in database.Here's below this code:
protected void Button1_Click(object sender, EventArgs e)
{
try
{
for (int i = 0; i < GridView2.Rows.Count; i++)
{
TextBox Tb = (TextBox)GridView2.Rows[i].FindControl("TextBoxCount");
Basket_DataTable.Rows[i]["Item"] = Tb.Text;
Basket_DataTable.Rows[i]["total"] = Convert.ToInt32(Tb.Text) * Convert.ToInt32(Basket_DataTable.Rows[i]["Price"]);
}
}
catch
{
}
Response.Redirect("TestShopcart.aspx");
}
AnoopGharu
6-Oct-14 3:41am
View
Thank you sir for your best concerned to me, but now I got the problem in your solution which you sent to me,the "count" can't work properly in my project while I am trying to give any other integer it does not update during that time and even though I using the "ObjectDataSource" to bind the GridView2 in mine project and when I am using here "QueryString" Parameter Source, then my selecting product go to the CartPage otherwise not,but If I used there "Session", it does not works well. So please help me to solve my these two problems.
AnoopGharu
30-Sep-14 11:06am
View
Sir I am working on a shopping website and I done all the work,now I start to work on the shopping Cart page, but I don't know what kind of class and method's I need to use there,which is appropriate for the shopping website like cookies, session etc to store the values of the products for the particular user and how I can achieve this in my project.
AnoopGharu
22-Sep-14 7:47am
View
By the way, now i got the exact solution of my problem, actually I didn't fill up the data fields at the top of the drop down list and it was in the string format.So that's the main reason I always got this error.
Anyway Thank you everybody for your best concern :)
AnoopGharu
22-Sep-14 6:42am
View
Thank you sir for your concern, Sir now again I got the above same error that "System.FormatException: Input string was not in a correct format".But in this case the coding of my aspx.cs page was little bit change, but the coding of aspx page is same as above I'd mention.The coding of my aspx.cs page is following:
public partial class Admin_ManageProducts : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);
}
protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
GridView1.DataBind();
}
protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
{
GridView1.DataBind();
}
}
So please do me favor and help me to fix this error.
AnoopGharu
20-Sep-14 5:34am
View
Thank you sir, Now I got it.Can you tell me please the mean of this following code:
"string fullFilePath = string.Format("{0}/{1}",absolutePath,fileName);"
because I wrote this line from an example.
AnoopGharu
18-Sep-14 1:44am
View
Thank you Sir :)
AnoopGharu
17-Sep-14 11:33am
View
Sir i got the solution of my above problem but now I am having problem related to SQL-Server database and the error is about the Foreign key.The error is that "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Products_Products". The conflict occurred in database "E-commerce", table "dbo.Category", column 'ID'.The statement has been terminated.".Please help me
AnoopGharu
17-Sep-14 11:09am
View
Thank you for your concern, now i resolve it :)
AnoopGharu
17-Sep-14 11:08am
View
Thank you Sir, now I got it but now I am having problem related to SQL-Server database and the error is about the Foreign key.The error is that "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Products_Products". The conflict occurred in database "E-commerce", table "dbo.Category", column 'ID'.The statement has been terminated."
AnoopGharu
9-Sep-14 6:09am
View
Thank you Sir now I got it :)
AnoopGharu
9-Sep-14 0:54am
View
Thank you, but why it showing the error "incorrect syntex near '=' " in the ExecuteNonQuery line in the DeleteStudent function, even I check the code and googling about this but i didn't find the error. So help me to solve out this error.
public static void DeleteStudent()
{
Console.WriteLine("Enter the rollno.");
string rollno=Console.ReadLine();
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=ps201\sqlexpress;Initial Catalog=Info_studednt;Integrated Security=True;Pooling=False";
con.Open();
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = "delete from students where=('"+ rollno +"')";
int rowsAffected =com.ExecuteNonQuery();//Error
if(rowsAffected != 0)
{
Console.WriteLine("Student deleted successfully.");
}
else
{
Console.WriteLine("Student not be deleted successfully.");
}
}
AnoopGharu
8-Sep-14 6:18am
View
Thank you Sir, here's in this ViewStudent function I got the one more error is "Cannot implicitly convert type 'int' to 'System.Data.SqlClient.SqlDataReader'" during the execution of "ExecuteNonQuery".Why always I got the error at this stage and how I can resolve it.
public static void ViewStudent()
{
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source=ps201\sqlexpress;Initial Catalog=Info_studednt;Integrated Security=True;Pooling=False";
con.Open();
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = "select * from students";
SqlDataReader dr=com.ExecuteNonQuery(); //Error
while(dr.Read())
{
Console.WriteLine(dr["name"]+":"+dr["rollno"]);
}
}
AnoopGharu
8-Sep-14 5:29am
View
Okey, can you please give me the brief example of parameterised query and how I need to write its code and what I need to mention there, because I am new to C#.
AnoopGharu
8-Sep-14 5:13am
View
Sir I did all the above work which you mentioned but in actual I also getting confuse while I try to write the insert query into the AddStudent function and when I try to Write the the "values(value1, value2)" then i didn't understand what I need to write there I just wrote there "name" variable which I'd already declare in AddStudent and when I write it, then it could lead to an error.So can you please tell me what I need to mention there and also about my problem.
AnoopGharu
6-Sep-14 6:12am
View
Thank you so much Sir.Now I got it.
AnoopGharu
6-Sep-14 5:15am
View
Thank you so much for your Best concern, I use your above given step in the coding but still the error can't go away and this time the error is "Cannot insert explicit value for identity column in table 'Emp' when IDENTITY_INSERT is set to OFF.".
Show More