.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 9th, 2005, 08:52 PM
erikkl2000 erikkl2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 6 erikkl2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 32 sec
Reputation Power: 0
How to call a sub

Hello All,

I need help to import sub into application.
First i will give a little detail how my application is set so you can help me (And so if i ask this question wrong you may be able to sift through the newbieness)
I have a componts folder that holds all of my class files (Like my comtrols, alot of my controls have their own namespace, class file)
My connection string is in my web.fig file so when ever i create a connection in my class files in my componets folder i write it like so--->... Dim cnn As New SqlConnection(ConfigurationSettings.AppSettings("cnn")) ...
When ever i call the function that returns a result for my control i do it like so-> ... Dim GetCompanyProductsFromTopMenu As New ConstructionSuperCenterCom.WindowTreatmentByCompan y

dlCom16.DataSource = GetCompanyProductsFromTopMenu.DataListForProductDi splayFromTopMenuSelection(IDCompany, IDCompanyProductCategory)
dlCom16.DataBind()...


Now, My question here is, how do i get to this sub and correctly implement it?
What i am doing here updating, editing, deleting info from a datagrid and i want to move all of this code to my componets folder and make a call from the behind file to the componts in the folder where needed in the behind file.

============Here is a piece of the code from the behind file that i am wanting to move to the componets folder,-----

Sub dgProducts_Edit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
dgUpdateProductRestrictions.EditItemIndex = e.Item.ItemIndex
BindData()
End Sub

Sub dgProducts_Cancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
dgUpdateProductRestrictions.EditItemIndex = -1
BindData()
End Sub

Sub dgProducts_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
'Read in the values of the updated row
Dim iProductID As Integer = e.Item.Cells(1).Text
Dim dblPrice As Double = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim strName As String = CType(e.Item.Cells(3).Controls(0), TextBox).Text
Dim strDesc As String = CType(e.Item.Cells(4).Controls(0), TextBox).Text


**How would i call the sub dgProducts_Update from the behind file?

Like This----> Dim MyUpdate as new (This would be namespace --->ConstructionSuperCenterCom)
MyUpdate.dgProducts_Update <----------????? i tried this but did not all the way work..

Can anyone help me on this???

Thank you...
Erik.,,..

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > How to call a sub


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT