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 February 10th, 2005, 03:52 AM
Authorized User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to NitinJoshi
Default Calling a function from .vb file to aspx file !!

ok....one more..

I've created a .vb file in that i have some functions..for database...
i need to call taht function from my aspx file's button (in this file i'm having a button.on that button's click event i want to call that .vb file function) how can i do this...

Thanx!!!

 
Old February 10th, 2005, 05:40 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

If you are using VS.NET you can't mix C# & VB file in the same application.Put the .dll for the .VB file inside your c# application using References in VS.NET.Include the namespace and you will be able to access methods written in that file in your .aspx.

 
Old February 10th, 2005, 05:46 AM
Authorized User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to NitinJoshi
Default

some thing like this..i've tried...
--------------------------------------------
Public Class SQl_insert
    Public Function insert(ByVal userid As Int32, ByVal username As String, ByVal password As String, ByVal user As String, ByVal firstname As String, ByVal lastname As String, ByVal phone As Int32, ByVal street As String, ByVal city As String, ByVal state As String, ByVal zip As Int32, ByVal country As String, ByVal Othercont As String)
        Dim sqlConn As SqlConnection
        Dim sqlCmd As SqlCommand
        Dim sqlCmd2 As SqlCommand
        Dim res As String

        sqlConn = New SqlConnection("server=localhost;uid=sa; pwd=;database=Databases;")
        sqlConn.Open()
        sqlCmd = New SqlCommand("Insert User_login_info values('username','password','User')", sqlConn)
        sqlCmd2 = New SqlCommand("Insert User_detail_info values('firstname','lastname',phone,'street','city ','state',zip,'country','Othercont')", sqlConn)
        sqlCmd.ExecuteNonQuery()
        sqlCmd2.ExecuteNonQuery()
        sqlConn.Close()

    End Function
End Class

'In aspx page..
'Dim insrt As SQl_insert
' insrt.insert(userid,tbox3,tbox4,tbox1,tbox2,tbox5, tbox6,tbox7,tbox8,tbox9,tbox10,tbox11,radiobutton1 )
-------------------------------------------
 
Old February 10th, 2005, 06:18 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

In Aspx page,
You should not use 'Dim insrt As SQl_insert
Create an instance of the Class SQl_insert using New operator.
and call the insert method.


 
Old February 10th, 2005, 06:23 AM
Authorized User
 
Join Date: Dec 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to NitinJoshi
Default

Thanx..For Help...







Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling Class within ASPX file kingroon ASP.NET 2.0 Basics 3 July 9th, 2008 07:43 AM
.aspx.vb file doesnt run arabuafef ASP.NET 2.0 Professional 7 March 18th, 2008 12:20 PM
Calling codebehind C# function from aspx page ravindrasingh77 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 16th, 2005 12:08 AM
Calling procedure of User Control from aspx file vskumar VB.NET 1 February 15th, 2005 11:17 AM
transfearing code to aspx file from vb file alyeng2000 ASP.NET 1.0 and 1.1 Professional 1 December 15th, 2003 11:12 AM





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