Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 January 10th, 2007, 09:14 AM
Authorized User
 
Join Date: Aug 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can I call a method that populate a Label???

Can I create a method that populate a label with userid without using a datagrid,datalist or a repeater? If so could guide me...Help!!
************************************************** ********************
I get the following error:
Compiler Error Message: BC30408: Method 'Public Function Getid(sender As Object, e As System.EventArgs) As Object' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
************************************************** ********************
In the form I have a label "lbl2"
...Some Code...
<asp:Label id="lbl2" runat="server" OnInit="Getid" />
...Some Code...

Function Getid(sender As Object, e As System.EventArgs)

Dim myConn AS OleDbConnection
Dim myAdapter As OleDbDataAdapter
Dim vData As DataSet
Dim query As String

'specify the data source
myConn = new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & server.mappath("/db/sel.mdb"))

'define the command query
query = "SELECT Distinct Salesman.Nroid FROM Customers,Salesman WHERE Salesman.Username='" & Context.User.Identity.Name &"'"

'create a command object and set its
myAdapter = New OleDbDataAdapter(query, myConn)

Try
 vData = new DataSet()
 myAdapter.Fill (vData)
catch
End Try
return vData

End Function

What am I doing wrong?

 
Old January 10th, 2007, 09:37 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Dont Double post.

http://p2p.wrox.com/topic.asp?TOPIC_ID=54293

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old January 12th, 2007, 05:39 AM
Authorized User
 
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abeen
Default

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
 is good !

=========================
  Success grows out of struggles to overcome difficulties.
My Email:abeen8298@gmail.com

=========================





Similar Threads
Thread Thread Starter Forum Replies Last Post
program that call its method automatically mfahadwallam BOOK: Beginning Java 2 0 January 28th, 2008 09:26 AM
Calling a function on every method call Takashi321 General .NET 1 September 21st, 2007 09:33 AM
Dynamically populate a label MaxGay2 VB.NET 2002/2003 Basics 27 November 15th, 2006 04:17 PM
How to call a method on a remote object eloyitomio C# 1 July 21st, 2006 10:17 AM
How to call a C# method from VB.Net? aliarifpk General .NET 1 February 26th, 2004 04:11 AM





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