16,012,025 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 NooobieCoder (Top 43 by date)
NooobieCoder
29-Dec-13 21:09pm
View
Hi, i want to show it through android application. My project has stopped working whenever I open it in android application. Isit because the JFrame does not support Android?
NooobieCoder
30-Jun-13 13:34pm
View
I have a folder in project that named "Images" where by I wan to save the uploaded image into it. The problem is when the user click insert, it can be stored into my database table, but not as the folderpath
So in my database table under Image column, I wan to get this : ~/Image/prod.jpg instead of prod.jpg
NooobieCoder
30-Jun-13 13:24pm
View
yes
NooobieCoder
22-Jun-13 23:30pm
View
but the thing is it can be updated thought there is this error. Meaning to say that, when I open in browser again, the updated value I type was there.
NooobieCoder
22-Jun-13 23:28pm
View
now I get this error when I update
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateProduct' that has parameters: prodName, prodDesc, prodImg, pCategoryID, prodPrice, stockQuantity, original_productID, productName, productDescription, productImg, productPrice.
NooobieCoder
22-Jun-13 14:04pm
View
alright now everything is working up till this line
cmd.ExecuteNonQuery();
Incorrect syntax near '='
NooobieCoder
22-Jun-13 13:56pm
View
alright now everything is working up till this line
cmd.ExecuteNonQuery();
Incorrect syntax near '='
NooobieCoder
22-Jun-13 13:38pm
View
hmm still the same error
NooobieCoder
22-Jun-13 12:59pm
View
ok thanks!
NooobieCoder
22-Jun-13 12:57pm
View
@CHill60 - thanks for helping me make it look nicer!
NooobieCoder
20-Jun-13 3:50am
View
hi, can u teach me on how to start a regex?
NooobieCoder
19-Jun-13 4:56am
View
thanks
NooobieCoder
19-Jun-13 2:36am
View
i change it but now my DAL class having problem
my deleteitem method have error say not all code paths return a value
NooobieCoder
19-Jun-13 2:35am
View
ok so i change it to String sql =.... already
but now my DAL class having problem
my deleteitem method have error say not all code paths return a value
NooobieCoder
19-Jun-13 2:32am
View
but my shoppingCartId is int data type
when i change it now my BLL have error
public int DeleteItem(int ShoppingCartID)
{
BQ_DAL dlSc = new BQ_DAL();
return dlSc.DeleteItem(ShoppingCartID);// this line the same error
}
NooobieCoder
19-Jun-13 2:28am
View
my shoppingcartID is int datatype, but the SqlCommand cmd = new SqlCommand(sql.ToString(),myConnection) is where by the (sql has to be string)
NooobieCoder
19-Jun-13 0:13am
View
SqlCommand(sql, myConnection);
i change it to sqlCommand(sql.ToInt32, myConnection)
however same problem occur again
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'DeleteItem' that has parameters: ShoppingCartID, original_shoppingCartID.
NooobieCoder
18-Jun-13 12:39pm
View
now they say BQ_DAL.deleteitem(int) : not all code paths return a value?
is it because i allow null in my db table?
NooobieCoder
18-Jun-13 11:44am
View
SqlConnection myConnection = new SqlConnection("DKGWConnectionString");
string sql = "Delete from BQ_ShoppingCart" + " where shoppingCartID = @shoppingCartID"; SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.AddWithValue("@shoppingCartID", ShoppingCartID);
cmd.CommandType = CommandType.Text;
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
isit like that?
i have error on myCommand and conn
NooobieCoder
18-Jun-13 11:19am
View
from the link u gave,
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand(SP_DELETE_USER, myConnection);
myCommand.Parameters.AddWithValue("@UserID", id);
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
the sp_delete_user what shd i changed to?
NooobieCoder
18-Jun-13 9:42am
View
after changing it, now my error is
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'DeleteItem' that has parameters: ShoppingCartID, original_shoppingCartID
NooobieCoder
18-Jun-13 7:21am
View
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
style="margin-right: 0px" onrowdatabound="GridView1_RowDataBound"
AllowPaging="True" DataKeyNames="shoppingCartID"
onrowcommand="GridView1_RowCommand">
<columns>
<asp:TemplateField>
<itemtemplate>
<asp:Button ID="Button1" runat="server" Text="delete"
CommandArgument="shoppingCartID" CommandName="DeleteRecord" />
<asp:BoundField DataField="productID" HeaderText="ID" />
<asp:BoundField DataField="productName" HeaderText="Name" />
<asp:BoundField DataField="quantity" HeaderText="Qty" />
<asp:BoundField DataField="productPrice" DataFormatString="{0:c}"
HeaderText="Price" />
<asp:BoundField DataField="productDescription" HeaderText="Desc" />
<asp:BoundField HeaderText="Sub Total" />
NooobieCoder
18-Jun-13 7:21am
View
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string strId = e.CommandArgument.ToString();
//int ShoppingCartID = GridView1.DataKeys[e.RowIndex].Value;
int ShoppingCartID = Convert.ToInt32(e.CommandArgument);
using (SqlConnection conn = new SqlConnection())
{
string sql = "Delete from BQ_ShoppingCart" +
" where shoppingCartID = @shoppingCartID";
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.AddWithValue(
"@shoppingCartID", ShoppingCartID);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
}
}
NooobieCoder
18-Jun-13 6:58am
View
when i put that it show me : input string was not in correct format.
NooobieCoder
18-Jun-13 6:24am
View
system.web.ui.webcontrols.gridviewCommandeventargs does not contain a definition for rowindex and no extension method rowindex accepting a first argument of type system.web.ui.webcontrols.gridviewcommandeventargs could be found.
NooobieCoder
18-Jun-13 6:15am
View
but there an error with RowIndex
NooobieCoder
18-Jun-13 6:03am
View
hmm it not working
NooobieCoder
18-Jun-13 5:54am
View
isit something like that?
int ShoppingCartID = GridView1.DataKeys[e.RowIndex].Value;
using (SqlConnection conn = new SqlConnection())
{
string sql = "Delete from PersonalDetail" +
" where shoppingCartID = @shoppingCartID";
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.AddWithValue(
"@shoppingCartID", ShoppingCartID);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
}
NooobieCoder
18-Jun-13 5:48am
View
SP?
NooobieCoder
18-Jun-13 5:43am
View
so i should change to what code?
NooobieCoder
18-Jun-13 5:42am
View
bad at*
NooobieCoder
18-Jun-13 5:41am
View
how to write the deletion method?sry I am very bad CRUD especially with gridview
NooobieCoder
18-Jun-13 5:38am
View
i got this code from online:x
NooobieCoder
18-Jun-13 5:29am
View
but my itemtemplate only have button no hiddenfield.
NooobieCoder
18-Jun-13 5:21am
View
sry but how do i check for the shoppingCartID?
NooobieCoder
18-Jun-13 5:11am
View
i add a button in the item template in gridview which i wan to use. Html of which one?
NooobieCoder
18-Jun-13 5:06am
View
i have tried this and get a new problem instead.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
GridViewRow gRow = (GridViewRow)(((Button)e.CommandSource).NamingContainer);
int RowIndex = gRow.RowIndex;
}
}
i get this problem :
ObjectDataSource 'ObjectDataSource' could not find a non-generic method 'Delete' that has parameters
NooobieCoder
18-Jun-13 5:04am
View
it is still the same.
NooobieCoder
17-Jun-13 23:43pm
View
I get this error when i click on my addtoCart btn and there a insert method in my btn
NooobieCoder
17-Jun-13 22:06pm
View
My DLL have no namespace, however my BLL have namespace
NooobieCoder
17-Jun-13 4:45am
View
by right the method should appear right?
NooobieCoder
17-Jun-13 4:45am
View
and my BLL:
public DataSet GetShoppingCart(string userID)
{
BQ_DAL dlSc = new BQ_DAL();
return dlSc.GetShoppingCart(userID);
}
NooobieCoder
17-Jun-13 4:45am
View
this is my DAL
public DataSet GetShoppingCart(string userID)
{
SqlConnection conn;
StringBuilder sql;
SqlDataAdapter da;
DataSet PCData;
conn = dbConn.GetConnection();
PCData = new DataSet();
sql = new StringBuilder();
sql.AppendLine("SELECT * FROM BQ_ShoppingCart");
sql.AppendLine("WHERE userID = @userID");
try
{
conn.Open();
da = new SqlDataAdapter(sql.ToString(), conn);
da.SelectCommand.Parameters.AddWithValue("@userID", userID);
da.Fill(PCData);
}
catch (Exception ex)
{
errMsg = ex.Message;
}
finally
{
conn.Close();
}
return PCData;
}
Show More