Last post Sep 27, 2007 03:38 PM by Fisel
Jul 24, 2007 01:40 PM|frost|LINK
This is a rather confusing problem but I'll do my best to sort through it and hopefully get some help. We have started converting a 1.1 app to a 2.0 app (vs 2003 to 2005). Using Scott Guthrie's online migration examples as well as following the vs 2005
mirgration process we are now at the point we are going through the painful process of correcting all the errors. One of these errors I believe is a combination of defining datasets from xsd files, and using external module functions for the data connection
We have a page in our app find.aspx page that loads many different usercontrols, all of which work relatively the same. The user opens the aspx page, which loads the usercontrol within it; when the user selects an item in that control and hits a button
a dataset is accessed by a connection which is created in a module file. I will try and break this down below to explain it better.
The find page is accessed and the usercontrol called cadastralSearch.ascx is loaded. A public event is accessed from button click event within that control:
The below public event has a bunch of parameters, the one for this example that we are concerned with is the DataSet.
Public Event SearchFinished(ByVal dsData As DataSet, ByVal bolNoSearchCriteria As Boolean, _
ByVal strClientFunctionName As String, _
ByVal strExtraParams As String, _
ByVal intColumnIndexForID As Integer, _
ByVal intColumnIndexForLatitude As Integer, _
ByVal intColumnIndexForLongitude As Integer)
Button click event:
The button click event passes the sql string to the sqldataAdapter which resides in a module.
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim strSQL, whereClause As String
strSQL = "SELECT DISTINCT Grid_ID, Cadastral_Area, Latitude, Longitude FROM view_Cadastral_Grid"
If Me.cboCadastral.SelectedIndex > 0 Then
whereClause = " WHERE Cadastral_Area = '" & Me.cboCadastral.SelectedItem.Text & "'"
'Nothing was passed
RaiseEvent SearchFinished(Nothing, True, "", "", 0, 0, 0)
Dim da As New SqlDataAdapter(strSQL + whereClause + " ORDER BY Cadastral_Area", modData.GetInternalCN)
Dim ds As New DataSet
RaiseEvent SearchFinished(ds, False, "findObj", "layer=Cadastral Grid;LayerGroup=Cadastral Grid;objZoomScale=7000", 0, 2, 3)
The sql string is passed to the module which in turn populates the dataset and returns the results.
Public Function GetInternalCN(Optional ByVal cnExisting As SqlConnection = Nothing) As SqlConnection
If Not IsNothing(cnExisting) Then
If cnExisting.State = ConnectionState.Open Then
Dim cn As New SqlConnection
.ConnectionString = Common.SiteConfiguration.ConnectionString
Now the problem that's arising is that the dataset is not getting populated and the sqlConnection, along with the sqlDataAdapter also cannot be found/fail. The application is not seeing the module which contains this information. We've added the reference
to the project with no luck. We also suspect it has something to do with the XSD files but don't know what we need to change.
We're very stuck at this point as we don't know how to connect to the module like we did in 1.1, nor do we know how what we need to update with regard to the xds files we use.
Any help would be greatly appreciated,
Jul 24, 2007 04:54 PM|frost|LINK
More and more I've been reading and seem to come across similar issues but nothing substancial. Is there a particilar folder structure that vs 2005 was supposed to generate when running the migration tool? I have seen alot of reference to a App_Code directory
which we don't have in our app. Most of the newly generated code that came from running the mirgration tool was designer.vb files. If the App_Code directory is missing then what else is missing? And what is supposed to be moved into those directory from
our old 1.1 app?
Sep 27, 2007 03:38 PM|Fisel|LINK
I just moved to VS2005 myself. I had the exact same problem with a module vb file. VS2005 does not create all of the folders you "might" need. If you select the Add ASP.NET Folder (right click on the project) and have it create the App_Code folder. Just
move your module into that folder and your golden.[cool]