Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 June 23rd, 2004, 10:24 PM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

O.k., I tried this...and sorry I can't make smart adjustments
becuase I don't yet have VB.Net skills to write my own solutions...
but when I used what you suggest, I got a syntax error (in VS.Net,
the bad part of the code has a squiggly blue line under it) on
this line:

"datagrid1.datasource = GetAdminVendorEquipment(Integer.Parse..."

...with the line under 'GetAdminVendorEquipment' and the tooltip
reading "GetAdminVendorEquipment is not declared".

I don't know what to add, syntax-wise to correct this. If you have
a suggestion, I'll give it a try.
Thanks again for all your help, Brian.....


R Corcoran, Jr.
 
Old June 24th, 2004, 07:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Wherever this function exists:

Public Overloads Function GetAdminVendorEquipment( _
      ByVal PropCompanyId As Integer) _
      As DataSet

You have to call it from the class object or whatever. To elaborate, if it is defined in the class AdminVendor, you would have to state it as:

Dim objVendor As New AdminVendor
objVendor.GetAdminVendorEquipment(..)

in the function:

Protected Sub PropCompanyNameList_IndexChanged( _
      ByVal sender As Object, _
      ByVal e As EventArgs)

Where are both of these defined. I guess that's what I'm confused about.

Thanks,

Brian
 
Old June 24th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

If you don't want to go that route, you could attempt to rewrite it. In a class or within the same ASP.NET page you can have the function that does:
Code:
Public Function GetData(intPropCompanyID As Integer) As DataTable
    Dim objConnection As New OleDBConnection(strConnString)
    Dim objAdapter As New SQLDataAdapter("sp_Properties_GetAdminVendorEquipment", objConnecction)
    objAdapter.SelectCommand.CommandTYpe = CommandType.StoredProcedure

    objAdapter.SelectCommand.Parameters.Add("@PropCompanyID", OleDBType.Integer, 10).Value = intPropCompanyID

    Dim objTable As New DataTable
    objAdapter.Fill(objTable)
    Return objTable.Copy()
End Function
THen in the change function:
Code:
Protected Sub PropCompanyNameList_IndexChanged( _
      ByVal sender As Object, _
      ByVal e As EventArgs)
    dim objTable As DataTable = LoadData(Integer.Parse(propcompanynamelist.selectedvalue))
    if (not isnothing(objTable)) then
        datagrid1.datasource = objtable.defaultview
        datagrid1.databind()
    end if
End Sub
Something like that.

Brian
 
Old June 24th, 2004, 04:07 PM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again, Brian.....
I think I need to back up a bit...what I'm trying to
do is stick with the code from 'thePhile' that the
book illustrates. my technique is to stay with the code
where I'm only changing names but not actual operations
because the code works perfectly on the sample website
(you might want to look at www.ericengler.com/default.aspx--
this is a forum poster who has put the site on the internet
so people can view it and play around with it without having
to set it up on their own VisualStudio-equipped terminal).

Anyway, I only change code or storedproc's when I have to because
my functionality will be different. So, the subroutine
"PropCompanyNameList_IndexChanged" is the same in my original
code with only my names (like 'PropCompanyNameList' instead of
'CategoryDropDown') substituted. That is why I'm trying to only focus on the code I've has to change to see where I might have
err'ed. That leads me to suspect my versions of the stored procedures
"sp_Properties_GetAdminVendorEquipment", "sp_Properties_GetProp-
CompanyName" and my code for "GetAdminVendorEquipment" in the
business tier and also my BindGrid and PageLoad subs in the
.aspx.vb code-behind for the page.

Sorry so long-winded. If you still would like to help, I can't tell
you how much I appreciate it, and let me know what pieces you
think we need to look at together and I'll send them.
Thx again....

R Corcoran, Jr.
 
Old June 26th, 2004, 11:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

> the code works perfectly on the sample website
>(you might want to look at www.ericengler.com/default.aspx

I made some changes to the code posted there. Most of my changes
are to close some security holes, and to make it work with a hosted
site.

I still need to make a few more changes before I release my code.
I'd like to find out if it's ok with Wrox to release it, though.
I don't know who to ask - does anybody know?

Eric
 
Old June 26th, 2004, 08:09 PM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Eric,
hope you're doing well....
Sorry I don't know what to tell you about that . . .
wish I did since I'm going to ask you a favor...
as you can see from this posting, Brian has been helping
me out with my redone version of '...admin/news.aspx'.
I have also posted on asp.net forum with a very concise
posting listing the code that I feel is the problem.
If you have a minute sometime soon to look at
http://www.asp.net/Forums/ShowPost.a...&PostID=616330
you might be able to help me crack this pretty quick.

Thanks a million and I'm still looking for a chance to help you out
sometime when I gain sufficient skills.
Thx much,

R Corcoran, Jr.
 
Old June 26th, 2004, 08:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's a lot of code, and I'm mostly into C# myself.
I saw your thread here, but I didn't have anything to offer,
so I didn't post a message.

Have you tied doing some tracing, breakpoints, etc?

Eric
 
Old June 27th, 2004, 05:20 PM
Authorized User
 
Join Date: Jul 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I guess I'll do that...need to brush up on my
VB.Net during vacation.....

Reid C.





Similar Threads
Thread Thread Starter Forum Replies Last Post
late binding meghaljani BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 6 August 22nd, 2008 07:06 PM
Binding A Variable sirmilt BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 February 25th, 2008 02:26 PM
binding arraylist of structures to data grid in C# belzicool General .NET 1 May 9th, 2007 11:58 PM
binding the grid to dataset?? thas123 ASP.NET 2.0 Basics 1 December 27th, 2006 02:15 PM





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