hi all
i have been on this problem for like 3 days now its time for some help cause it driving me insane..
i am using SQL SERVER 2000 where my database is stored.. i am using the northwind database.
i am using vb.net and asp.net. i have a webform1 that has the connection to the database on the startup page i am using the server explorer to add the sqlconnection , sqladapater and the dataset components.. i am caching the the components if the page is not posted back to the server and filling the dataset with the data: my code on the first form is as follows
on the main page(webform1) i have a link which takes you to another webform2 and i have a dropdownlist on webform2 which needs to be databinded to fill up the dropdownlist which i have..my code on webform2 is as follows
can someone please help because nothing is filling up my dropdownlist..
thanks in advance... hope i explained myself ok...
i have been on this problem for like 3 days now its time for some help cause it driving me insane..
i am using SQL SERVER 2000 where my database is stored.. i am using the northwind database.
i am using vb.net and asp.net. i have a webform1 that has the connection to the database on the startup page i am using the server explorer to add the sqlconnection , sqladapater and the dataset components.. i am caching the the components if the page is not posted back to the server and filling the dataset with the data: my code on the first form is as follows
Visual Basic:
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
If Not IsPostBack Then
'add the tables to the cache
addtocache("SqlDataAdapter2", SqlDataAdapter2) '"adaptCustomerCustomerDemo"
'fill the datasets
SqlDataAdapter2.Fill(DsCustomerCustomerDemo1)
addtocache("DsCustomerCustomerDemo1", DsCustomerCustomerDemo1) 'dsCustomerCustomerDemo
End If
End Sub
Sub addtocache(ByVal name As String, ByVal obj As Object)
If Not IsNothing(Cache(name)) Then Return
Cache.Add(name, obj, Nothing, DateTime.MaxValue, System.TimeSpan.FromMinutes(20), _
Caching.CacheItemPriority.Default, Nothing)
End Sub
Visual Basic:
imports system.data.sqlclient
public sqlDataAdapter2 as sqlDataAdapter '
Public dsCustomerCustomerDemo1 As dsCustomerCustomerDemo
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
dsCustomerCustomerDemo1 = Cache("dsCustomerCustomerDemo1")
If Not IsPostBack Then
drpCustomerCustomerDemo.DataBind()
End If
End Sub
can someone please help because nothing is filling up my dropdownlist..
thanks in advance... hope i explained myself ok...