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 September 19th, 2006, 03:03 AM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection property has not been initialized

Hi,to everyone
What i want about this is In first form there is one search button.When i enter the data and click the search button it goes to the second form.In second form there is only one DataGrid.

When i click that button it goes to the database and retrieve the data from database and shows only that particular details only.so plz.. help me.
Is there any modifications in that plz modify and send me .......plz.




This is code in one form:

Imports System.Data
Imports System.Data.OleDb
Public Class tracknumber
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

End Sub

Private Sub btntrack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntrack.Click
Dim con As New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring"))
Dim tracknumber As Integer
con.Open()
Dim cmd As New OleDbCommand
cmd.Connection = con
Response.Redirect("database.aspx")
con.Close()
End Sub
End Class



This the code in second form:

Imports System.Data.OleDb

Public Class database
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim con As New OleDbConnection(ConfigurationSettings.AppSettings( "connectionstring"))
Dim TrackNumber As Integer
Dim cmd As New OleDbCommand("select * from track where TrackNumber='" & Request.QueryString("TrackNumber") & " ' ", con)
con.Open()
DataGrid1.DataSource = cmd.ExecuteReader()
DataGrid1.DataBind()
con.Close()
End Sub
End Class







Similar Threads
Thread Thread Starter Forum Replies Last Post
ExecuteReader: Connection property has not been in Follie Visual Studio 2005 3 October 14th, 2008 04:06 AM
Specify the connection string property at runtime Lawrence C. Zauberis BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 1 July 7th, 2006 09:40 AM
Connection Property:Has not been initialized louie001 ASP.NET 1.0 and 1.1 Basics 1 October 17th, 2005 11:46 PM
connection not initialized jazzcatone ASP.NET 1.x and 2.0 Application Design 1 July 29th, 2005 01:02 PM
Connection has not initialized Properly ERROR!!!! ramana123 ASP.NET 1.0 and 1.1 Basics 0 July 7th, 2005 01:01 AM





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