Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2004, 12:25 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default DataGrid cant rebind... pls help o any advice

ARGH.... Hi,
I trying to get my datagrid binded after users click on update link button in datagrid...
can anyone help me on this...
i've check the sql statement: Select * From StockOnHand Where ItemCode=ABC
my code looks fine, but y it show error to me....

No value given for one or more required parameters.
Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.

Source Error:

Line 256: ObjCmd1.Fill(DsStockOnHand, "StockOnHand")

Here is my code



Function UpdateStore(e as DataGridCommandEventArgs)

...

... ' update record, no problem

...



'Bind data after update



lbldg.Text=Ctype(e.Item.Cells(2).Controls(0), textbox).text

Dim strFillDg as string="Select * From StockOnHand Where ItemCode=" & Ctype(e.Item.Cells(2).Controls(0), textbox).text



    dim ObjCmd1 as new OleDbDataAdapter(strFillDg, Conn)

    dim DsStockOnHand as DataSet = new DataSet()

    response.Write(strfilldg)



 'try



    ObjCmd1.Fill(DsStockOnHand, "StockOnHand")

    DgData.DataSource = DsStockOnHand.Tables("StockOnHand").DefaultView

    DgData.DataBind()



 'catch ex as OleDbException

 'end try



     FillDataGrid1(-1)

     return blnGo



end function




Can any1 helps? Thanks in advance...
Regards
life's Ng

 
Old August 26th, 2004, 07:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

What is Conn (a OleDbConnection or a Connection string)? In addition, What does FillDataGrid1 do?

I wonder if the problem is with the connection, and not the adapter. When the adapter fills a data set, it opens the connection, which the problem could look like the adapter, but be something else.

Brian
 
Old August 26th, 2004, 10:00 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

Hi, Thanks for reply!

Conn is a OleDbconnection, thanks for ur suggestion, i will take note of this next time(Coz i already delete this junk of code yesterday due to frustration... :P)

Regards
life's Ng

 
Old August 30th, 2004, 07:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Then, are you still having problems? If so, let me know the new error and post updated code.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
XML XSLT AJAX and Database Advice Pls newbieboobers XSLT 2 March 20th, 2008 08:53 AM
Datagrid - selected item display advice janetb ASP.NET 1.0 and 1.1 Basics 2 May 9th, 2006 02:56 PM
Advice 95_rifleman VB Databases Basics 2 February 13th, 2006 08:15 AM
rebind dataset from web service after click button blur_ivy .NET Web Services 2 April 15th, 2005 09:09 AM
datagrid problem urgent pls. dsmportal Pro VB.NET 2002/2003 0 February 7th, 2005 09:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.