Solved

Opening web site created with Visual Studio 2008 in Visual Studio 2010

Posted on 2011-02-17
48
2,721 Views
Last Modified: 2012-05-11
We just installed new Windows Server 2008 R2 servers to replace our '2003 servers so I'm starting to copy web sites from the old web server to the new one.

While the web sites were on Windows Server 2003, I've been developing the sites with Visual Studio 2008. (They are all internal web forms for data entry and management of SQL Server 2005 databases.)

So, I xcopy a small, simple website called "Reports" from \\OldServer\E$\Inetpub\Reports to \\NewServer\E$\Inetpub\Reports

When I open the website in Visual Studio 2010 I get an error like the one below.  After some Googling I create a new web application in VS2010 and copy that web.config into "Reports", update the connectionString and authentication mode and identity from the original one then load "Reports" in VS2010 and get these errors:

They say "Microsoft.CSharp" assembly failed to load.  I'm puzzled about that because I only use VB.

I just went ahead and pasted all the code for the site.  I have actually been trying to get a project in VS2010 to work for a long time with no success.

Oh, this Reports website actually does load up fine in a browser on another computer. Records load in the GridView and everything.  I really don't know what's going on here with the errors.  ;-)

Warning	1	\\intraserv\e$\inetpub\Reports\Default.aspx: ASP.NET runtime error: 
Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 
Either a required impersonation level was not provided, or the provided impersonation level is invalid. 
(Exception from HRESULT: 0x80070542)	\\intraserv\e$\inetpub\Reports\Default.aspx	1	1	\\NewServer\E$\inetpub\Reports\

Error	2	Could not load file or assembly 'Microsoft.CSharp, Version=4.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 
Either a required impersonation level was not provided, or the provided impersonation level is invalid. 
(Exception from HRESULT: 0x80070542)		

Open in new window

I copied this web.config from a freshly created VS2010 project:
<?xml version="1.0" encoding="UTF-8"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
	<add name="WIACaseloadConnectionString1" connectionString="Data Source=SQLSERVER;Initial Catalog=WIACaseload;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />

	<authentication mode="Windows" />
	<identity impersonate="true" userName="DOMAIN\myloginname" password="MyP@ssw@rd" />

    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true" />
        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
                <add value="Default.htm" />
                <add value="iisstart.htm" />
            </files>
        </defaultDocument>
  </system.webServer>
</configuration>

Open in new window

Imports System.Data
Imports System.Data.SqlClient

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


        'This puts a count of the Considered applicants in the label.
        'If Not Page.IsPostBack Then
        'Try using this to point to the connection string in the web.config.  Then it only needs to be changed in one place.
        'ConfigurationManager.ConnectionStrings["WIACaseloadConnectionString1"].ConnectionString
        Dim DBConn As New SqlConnection(ConfigurationManager.ConnectionStrings("WIACaseloadConnectionString1").ConnectionString)
        'Dim DBConn As New SqlConnection("UID=dmegnin;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SYEP2007;Data Source=BETASERVE;Packet Size=4096;")

        Dim sProgram As String = dlProgram.SelectedValue.ToString
        Dim sCM As String = dlCM.SelectedValue.ToString

        Dim DBCmd As New SqlCommand
        'Dim DBCmd2 As New SqlCommand
        'Dim DBCmd3 As New SqlCommand
        'Dim DBCmd4 As New SqlCommand
        DBConn.Open()
        Try
            ''lblCounts.Text = Convert.ToString(DBCmd.ExecuteScalar())
            DBCmd = New SqlCommand("SELECT COUNT([Case ID Number]) FROM [WIACaseload].[dbo].[WIA Caseload] WHERE (Program LIKE '%" & sProgram & "' AND CM LIKE '%" & sCM & "%')", DBConn)
            'DBCmd2 = New SqlCommand("SELECT COUNT(txtConsidered) FROM[Applicants] WHERE ((keyApplicantID > 200900000) AND (Status = 1))", DBConn)
            'DBCmd4 = New SqlCommand("SELECT COUNT(txtConsidered) FROM[Applicants] WHERE ((keyApplicantID > 200900000) AND (Status = 2))", DBConn)
            'DBCmd3 = New SqlCommand("SELECT SUM(txtWorksiteJobTitlePositionsNumber) FROM[JobTitles] WHERE (WorksiteName NOT LIKE '%zzz%')", DBConn)
            'lblCounts.Text = Convert.ToString(DBCmd.ExecuteScalar())
            Dim varCount As Integer = DBCmd.ExecuteScalar()
            'Dim varCount2 As Integer = DBCmd2.ExecuteScalar()
            'Dim varCount3 As Integer = DBCmd3.ExecuteScalar()
            'Dim varCount4 As Integer = DBCmd4.ExecuteScalar()

            lblCount.Text = "  Count: [" & varCount.ToString & " ]"
            'lblConsidered.Text = " Considered: " & varCount.ToString & ", " '& " Paperwork Complete: " & varCount2.ToString & ", " & " Paperwork Pending: " & varCount4.ToString & ", " & " Positions: " & varCount3.ToString
            'lblComplete.Text = " Paperwork Complete: " & varCount2.ToString & ", "
            'lblPending.Text = " Paperwork Pending: " & varCount4.ToString & ", "
            'lblPositions.Text = " Positions: " & varCount3.ToString
        Catch exp As Exception
            Response.Write(exp)
        End Try
        DBCmd.Dispose()
        'DBCmd2.Dispose()
        'DBCmd3.Dispose()
        DBConn.Close()
        DBConn = Nothing
        'End If

    End Sub
End Class

Open in new window

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
      function pageLoad() {
      }
    
    </script>
<style type="text/css">
h1 {text-align:center; color:#006D75;}
</style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        
        <h1>WIA Caseload</h1>
		<asp:DropDownList ID="dlProgram" runat="server" AutoPostBack="True">
			<asp:ListItem Value="%%">&lt;&lt; Program &gt;&gt;</asp:ListItem>
			<asp:ListItem Value="AD">AD</asp:ListItem>
			<asp:ListItem Value="AD-A">AD-A</asp:ListItem>
			<asp:ListItem Value="DW">DW</asp:ListItem>
			<asp:ListItem Value="DW-A">DW-A</asp:ListItem>
		</asp:DropDownList>

		<asp:DropDownList ID="dlCM" runat="server" AutoPostBack="True">
			<asp:ListItem Value="%%">&lt;&lt; Case Manager &gt;&gt;</asp:ListItem>
			<asp:ListItem Value="Aho">Aho</asp:ListItem>
			<asp:ListItem Value="Butler">Butler</asp:ListItem>
			<asp:ListItem Value="Ferretti">Ferretti</asp:ListItem>
			<asp:ListItem Value="Murray">Murray</asp:ListItem>
			<asp:ListItem Value="Ortega">Ortega</asp:ListItem>
			<asp:ListItem Value="Pierson">Pierson</asp:ListItem>
			<asp:ListItem Value="Rich">Rich</asp:ListItem>
			<asp:ListItem Value="Ridgway">Ridgway</asp:ListItem>
			<asp:ListItem Value="Thompson">Thompson</asp:ListItem>
		</asp:DropDownList>
    	<asp:Label ID="lblCount" runat="server" Text="Count Label"></asp:Label>
    	<br />
		<asp:GridView ID="gvWIACaseload" runat="server" AllowSorting="True" AutoGenerateColumns="False" 
			CellPadding="4" DataKeyNames="Case ID Number" DataSourceID="SqlDataSource1" ForeColor="#333333">
			<RowStyle BackColor="#EFF3FB" />
			<Columns>
				<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowSelectButton="True" />
				<asp:BoundField DataField="Case ID Number" HeaderText="Case ID Number" InsertVisible="False" ReadOnly="True" SortExpression="Case ID Number" />
				<asp:BoundField DataField="LName" HeaderText="LName" SortExpression="LName" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="SSN" HeaderText="SSN" SortExpression="SSN">
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Level" HeaderText="Level" SortExpression="Level" />
				<asp:BoundField DataField="Program" HeaderText="Program" SortExpression="Program" />
				<asp:BoundField DataField="Enroll Date" HeaderText="Reg/Enroll Date" SortExpression="Enroll Date" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Current Activity" HeaderText="Current Activity" SortExpression="Current Activity" />
				<asp:BoundField DataField="Date Activity Began" HeaderText="Date Activity Began" SortExpression="Date Activity Began" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="ITA" HeaderText="ITA" SortExpression="ITA" />
				<asp:BoundField DataField="Tng Inst" HeaderText="Tng Inst" SortExpression="Tng Inst" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Tng Pro" HeaderText="Tng Pro" SortExpression="Tng Pro" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Date Contact" HeaderText="Date Contact" SortExpression="Date Contact" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="CM" HeaderText="CM" SortExpression="CM" />
				<asp:BoundField DataField="Closure Date" HeaderText="Closure Date" SortExpression="Closure Date" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Closure Reason" HeaderText="Closure Reason" SortExpression="Closure Reason" />
				<asp:BoundField DataField="End Date" HeaderText="End Date" SortExpression="End Date" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Hire Date" HeaderText="Hire Date" SortExpression="Hire Date" 
											DataFormatString="{0:d}" HtmlEncode="False" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" />
				<asp:BoundField DataField="TAA" HeaderText="TAA" SortExpression="TAA" />
				<asp:CheckBoxField DataField="30 Day" HeaderText="30 Day" SortExpression="30 Day" />
				<asp:CheckBoxField DataField="60 Day" HeaderText="60 Day" SortExpression="60 Day" />
				<asp:CheckBoxField DataField="1Qtr" HeaderText="1Qtr" SortExpression="1Qtr" />
				<asp:CheckBoxField DataField="2Qtr" HeaderText="2Qtr" SortExpression="2Qtr" />
				<asp:CheckBoxField DataField="3Qtr" HeaderText="3Qtr" SortExpression="3Qtr" />
				<asp:CheckBoxField DataField="4Qtr" HeaderText="4Qtr" SortExpression="4Qtr" />
				<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
				<asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
				<asp:BoundField DataField="Tel" HeaderText="Tel" SortExpression="Tel"  >
											<ItemStyle Wrap="False" />
				</asp:BoundField>
				<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
				<asp:BoundField DataField="Wages" HeaderText="Wages" SortExpression="Wages" />
				<asp:BoundField DataField="C_Over" HeaderText="C/Over" SortExpression="C_Over" />
				<asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
			</Columns>
			<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
			<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
			<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
			<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
			<EditRowStyle BackColor="#FFCCFF" />
			<AlternatingRowStyle BackColor="White" />
		</asp:GridView>
		<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
			ConnectionString="<%$ ConnectionStrings:WIACaseloadConnectionString1 %>" 
			DeleteCommand="DELETE FROM [WIA Caseload] WHERE [Case ID Number] = @original_Case_ID_Number" 
			InsertCommand="INSERT INTO [WIA Caseload] ([LName], [FName], [SSN], [Level], [Program], [Enroll Date], [Current Activity], [Date Activity Began], [ITA], [Tng Inst], [Tng Pro], [Date Contact], [CM], [Closure Date], [Closure Reason], [End Date], [Hire Date], [Active], [TAA], [30 Day], [60 Day], [1Qtr], [2Qtr], [3Qtr], [4Qtr], [Address], [City], [State], [Zip], [Tel], [Email], [Wages], [C_Over], [Comments]) VALUES (@LName, @FName, @SSN, @Level, @Program, @Enroll_Date, @Current_Activity, @Date_Activity_Began, @ITA, @Tng_Inst, @Tng_Pro, @Date_Contact, @CM, @Closure_Date, @Closure_Reason, @End_Date, @Hire_Date, @Active, @TAA, @column1, @column2, @column3, @column4, @column5, @column6, @Address, @City, @State, @Zip, @Tel, @Email, @Wages, @C_Over, @Comments)" 
			OldValuesParameterFormatString="original_{0}" 
			SelectCommand="SELECT * FROM [WIA Caseload] WHERE ([CM] LIKE '%' + @CM + '%') AND ([Program] LIKE '%' + @Program + '') ORDER BY [LName], [FName]" 
			UpdateCommand="UPDATE [WIA Caseload] SET [LName] = @LName, [FName] = @FName, [SSN] = @SSN, [Level] = @Level, [Program] = @Program, [Enroll Date] = @Enroll_Date, [Current Activity] = @Current_Activity, [Date Activity Began] = @Date_Activity_Began, [ITA] = @ITA, [Tng Inst] = @Tng_Inst, [Tng Pro] = @Tng_Pro, [Date Contact] = @Date_Contact, [CM] = @CM, [Closure Date] = @Closure_Date, [Closure Reason] = @Closure_Reason, [End Date] = @End_Date, [Hire Date] = @Hire_Date, [Active] = @Active, [TAA] = @TAA, [30 Day] = @column1, [60 Day] = @column2, [1Qtr] = @column3, [2Qtr] = @column4, [3Qtr] = @column5, [4Qtr] = @column6, [Address] = @Address, [City] = @City, [State] = @State, [Zip] = @Zip, [Tel] = @Tel, [Email] = @Email, [Wages] = @Wages, [C_Over] = @C_Over, [Comments] = @Comments WHERE [Case ID Number] = @original_Case_ID_Number">
			<SelectParameters>
				<asp:ControlParameter ControlID="dlProgram" Name="Program" PropertyName="SelectedValue" Type="String" />
				<asp:ControlParameter ControlID="dlCM" Name="CM" PropertyName="SelectedValue" Type="String" />
			</SelectParameters>
			<DeleteParameters>
				<asp:Parameter Name="original_Case_ID_Number" Type="Int32" />
			</DeleteParameters>
			<UpdateParameters>
				<asp:Parameter Name="LName" Type="String" />
				<asp:Parameter Name="FName" Type="String" />
				<asp:Parameter Name="SSN" Type="String" />
				<asp:Parameter Name="Level" Type="String" />
				<asp:Parameter Name="Program" Type="String" />
				<asp:Parameter Name="Enroll_Date" Type="DateTime" />
				<asp:Parameter Name="Current_Activity" Type="String" />
				<asp:Parameter Name="Date_Activity_Began" Type="DateTime" />
				<asp:Parameter Name="ITA" Type="String" />
				<asp:Parameter Name="Tng_Inst" Type="String" />
				<asp:Parameter Name="Tng_Pro" Type="String" />
				<asp:Parameter Name="Date_Contact" Type="DateTime" />
				<asp:Parameter Name="CM" Type="String" />
				<asp:Parameter Name="Closure_Date" Type="DateTime" />
				<asp:Parameter Name="Closure_Reason" Type="String" />
				<asp:Parameter Name="End_Date" Type="DateTime" />
				<asp:Parameter Name="Hire_Date" Type="DateTime" />
				<asp:Parameter Name="Active" Type="String" />
				<asp:Parameter Name="TAA" Type="String" />
				<asp:Parameter Name="column1" Type="Boolean" />
				<asp:Parameter Name="column2" Type="Boolean" />
				<asp:Parameter Name="column3" Type="Boolean" />
				<asp:Parameter Name="column4" Type="Boolean" />
				<asp:Parameter Name="column5" Type="Boolean" />
				<asp:Parameter Name="column6" Type="Boolean" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="State" Type="String" />
				<asp:Parameter Name="Zip" Type="String" />
				<asp:Parameter Name="Tel" Type="String" />
				<asp:Parameter Name="Email" Type="String" />
				<asp:Parameter Name="Wages" Type="Decimal" />
				<asp:Parameter Name="C_Over" Type="String" />
				<asp:Parameter Name="Comments" Type="String" />
				<asp:Parameter Name="original_Case_ID_Number" Type="Int32" />
			</UpdateParameters>
			<InsertParameters>
				<asp:Parameter Name="LName" Type="String" />
				<asp:Parameter Name="FName" Type="String" />
				<asp:Parameter Name="SSN" Type="String" />
				<asp:Parameter Name="Level" Type="String" />
				<asp:Parameter Name="Program" Type="String" />
				<asp:Parameter Name="Enroll_Date" Type="DateTime" />
				<asp:Parameter Name="Current_Activity" Type="String" />
				<asp:Parameter Name="Date_Activity_Began" Type="DateTime" />
				<asp:Parameter Name="ITA" Type="String" />
				<asp:Parameter Name="Tng_Inst" Type="String" />
				<asp:Parameter Name="Tng_Pro" Type="String" />
				<asp:Parameter Name="Date_Contact" Type="DateTime" />
				<asp:Parameter Name="CM" Type="String" />
				<asp:Parameter Name="Closure_Date" Type="DateTime" />
				<asp:Parameter Name="Closure_Reason" Type="String" />
				<asp:Parameter Name="End_Date" Type="DateTime" />
				<asp:Parameter Name="Hire_Date" Type="DateTime" />
				<asp:Parameter Name="Active" Type="String" />
				<asp:Parameter Name="TAA" Type="String" />
				<asp:Parameter Name="column1" Type="Boolean" />
				<asp:Parameter Name="column2" Type="Boolean" />
				<asp:Parameter Name="column3" Type="Boolean" />
				<asp:Parameter Name="column4" Type="Boolean" />
				<asp:Parameter Name="column5" Type="Boolean" />
				<asp:Parameter Name="column6" Type="Boolean" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="State" Type="String" />
				<asp:Parameter Name="Zip" Type="String" />
				<asp:Parameter Name="Tel" Type="String" />
				<asp:Parameter Name="Email" Type="String" />
				<asp:Parameter Name="Wages" Type="Decimal" />
				<asp:Parameter Name="C_Over" Type="String" />
				<asp:Parameter Name="Comments" Type="String" />
			</InsertParameters>
		</asp:SqlDataSource>
		<br />
		<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False" 
			CellPadding="4" DataKeyNames="Case ID Number" DataSourceID="SqlDataSource2" ForeColor="#333333" 
			Height="50px" Width="525px" DefaultMode="Insert">
			<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
			<CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
			<RowStyle BackColor="#EFF3FB" />
			<FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
			<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
			<Fields>
				<asp:BoundField DataField="Case ID Number" HeaderText="Case ID Number" InsertVisible="False" 
					ReadOnly="True" SortExpression="Case ID Number"></asp:BoundField>
				<asp:BoundField DataField="LName" HeaderText="LName" SortExpression="LName" />
				<asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName" />
				<asp:BoundField DataField="SSN" HeaderText="SSN" SortExpression="SSN" />
				<asp:BoundField DataField="Level" HeaderText="Level" SortExpression="Level" />
				<asp:BoundField DataField="Program" HeaderText="Program" SortExpression="Program" />
				<asp:BoundField DataField="Enroll Date" HeaderText="Enroll Date" SortExpression="Enroll Date" />
				<asp:BoundField DataField="Current Activity" HeaderText="Current Activity" 
					SortExpression="Current Activity" />
				<asp:BoundField DataField="Date Activity Began" HeaderText="Date Activity Began" 
					SortExpression="Date Activity Began" />
				<asp:BoundField DataField="ITA" HeaderText="ITA" SortExpression="ITA" />
				<asp:BoundField DataField="Tng Inst" HeaderText="Tng Inst" SortExpression="Tng Inst" />
				<asp:BoundField DataField="Tng Pro" HeaderText="Tng Pro" SortExpression="Tng Pro" />
				<asp:BoundField DataField="Date Contact" HeaderText="Date Contact" SortExpression="Date Contact" />
				<asp:BoundField DataField="CM" HeaderText="CM" SortExpression="CM" />
				<asp:BoundField DataField="Closure Date" HeaderText="Closure Date" SortExpression="Closure Date" />
				<asp:BoundField DataField="Closure Reason" HeaderText="Closure Reason" 
					SortExpression="Closure Reason" />
				<asp:BoundField DataField="End Date" HeaderText="End Date" SortExpression="End Date" />
				<asp:BoundField DataField="Hire Date" HeaderText="Hire Date" SortExpression="Hire Date" />
				<asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" />
				<asp:BoundField DataField="TAA" HeaderText="TAA" SortExpression="TAA" />
				<asp:CheckBoxField DataField="30 Day" HeaderText="30 Day" SortExpression="30 Day" />
				<asp:CheckBoxField DataField="60 Day" HeaderText="60 Day" SortExpression="60 Day" />
				<asp:CheckBoxField DataField="1Qtr" HeaderText="1Qtr" SortExpression="1Qtr" />
				<asp:CheckBoxField DataField="2Qtr" HeaderText="2Qtr" SortExpression="2Qtr" />
				<asp:CheckBoxField DataField="3Qtr" HeaderText="3Qtr" SortExpression="3Qtr" />
				<asp:CheckBoxField DataField="4Qtr" HeaderText="4Qtr" SortExpression="4Qtr" />
				<asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
				<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
				<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
				<asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
				<asp:BoundField DataField="Tel" HeaderText="Tel" SortExpression="Tel" />
				<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
				<asp:BoundField DataField="Wages" HeaderText="Wages" SortExpression="Wages" />
				<asp:BoundField DataField="C_Over" HeaderText="C_Over" SortExpression="C_Over" />
				<asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
				<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
			</Fields>
			<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
			<EditRowStyle BackColor="#2461BF" />
			<AlternatingRowStyle BackColor="White" />
		</asp:DetailsView>
		<br />
		<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
			ConnectionString="<%$ ConnectionStrings:WIACaseloadConnectionString1 %>" 
			DeleteCommand="DELETE FROM [WIA Caseload] WHERE [Case ID Number] = @Case_ID_Number" 
			InsertCommand="INSERT INTO [WIA Caseload] ([LName], [FName], [SSN], [Level], [Program], [Enroll Date], [Current Activity], [Date Activity Began], [ITA], [Tng Inst], [Tng Pro], [Date Contact], [CM], [Closure Date], [Closure Reason], [End Date], [Hire Date], [Active], [TAA], [30 Day], [60 Day], [1Qtr], [2Qtr], [3Qtr], [4Qtr], [Address], [City], [State], [Zip], [Tel], [Email], [Wages], [C_Over], [Comments]) VALUES (@LName, @FName, @SSN, @Level, @Program, @Enroll_Date, @Current_Activity, @Date_Activity_Began, @ITA, @Tng_Inst, @Tng_Pro, @Date_Contact, @CM, @Closure_Date, @Closure_Reason, @End_Date, @Hire_Date, @Active, @TAA, @column1, @column2, @column3, @column4, @column5, @column6, @Address, @City, @State, @Zip, @Tel, @Email, @Wages, @C_Over, @Comments)" 
			SelectCommand="SELECT [Case ID Number], LName, FName, SSN, Level, Program, [Enroll Date], [Current Activity], [Date Activity Began], ITA, [Tng Inst], [Tng Pro], [Date Contact], CM, [Closure Date], [Closure Reason], [End Date], [Hire Date], Active, TAA, [30 Day], [60 Day], [1Qtr], [2Qtr], [3Qtr], [4Qtr], Address, City, State, Zip, Tel, Email, Wages, C_Over, Comments FROM [WIA Caseload] WHERE ([Case ID Number] = @Case_ID_Number)" 
			UpdateCommand="UPDATE [WIA Caseload] SET [LName] = @LName, [FName] = @FName, [SSN] = @SSN, [Level] = @Level, [Program] = @Program, [Enroll Date] = @Enroll_Date, [Current Activity] = @Current_Activity, [Date Activity Began] = @Date_Activity_Began, [ITA] = @ITA, [Tng Inst] = @Tng_Inst, [Tng Pro] = @Tng_Pro, [Date Contact] = @Date_Contact, [CM] = @CM, [Closure Date] = @Closure_Date, [Closure Reason] = @Closure_Reason, [End Date] = @End_Date, [Hire Date] = @Hire_Date, [Active] = @Active, [TAA] = @TAA, [30 Day] = @column1, [60 Day] = @column2, [1Qtr] = @column3, [2Qtr] = @column4, [3Qtr] = @column5, [4Qtr] = @column6, [Address] = @Address, [City] = @City, [State] = @State, [Zip] = @Zip, [Tel] = @Tel, [Email] = @Email, [Wages] = @Wages, [C_Over] = @C_Over, [Comments] = @Comments WHERE [Case ID Number] = @Case_ID_Number">
			<SelectParameters>
				<asp:ControlParameter ControlID="gvWIACaseload" Name="Case_ID_Number" PropertyName="SelectedValue" 
					Type="Int32" />
			</SelectParameters>
			<DeleteParameters>
				<asp:Parameter Name="Case_ID_Number" Type="Int32" />
			</DeleteParameters>
			<UpdateParameters>
				<asp:Parameter Name="LName" Type="String" />
				<asp:Parameter Name="FName" Type="String" />
				<asp:Parameter Name="SSN" Type="String" />
				<asp:Parameter Name="Level" Type="String" />
				<asp:Parameter Name="Program" Type="String" />
				<asp:Parameter Name="Enroll_Date" Type="DateTime" />
				<asp:Parameter Name="Current_Activity" Type="String" />
				<asp:Parameter Name="Date_Activity_Began" Type="DateTime" />
				<asp:Parameter Name="ITA" Type="String" />
				<asp:Parameter Name="Tng_Inst" Type="String" />
				<asp:Parameter Name="Tng_Pro" Type="String" />
				<asp:Parameter Name="Date_Contact" Type="DateTime" />
				<asp:Parameter Name="CM" Type="String" />
				<asp:Parameter Name="Closure_Date" Type="DateTime" />
				<asp:Parameter Name="Closure_Reason" Type="String" />
				<asp:Parameter Name="End_Date" Type="DateTime" />
				<asp:Parameter Name="Hire_Date" Type="DateTime" />
				<asp:Parameter Name="Active" Type="String" />
				<asp:Parameter Name="TAA" Type="String" />
				<asp:Parameter Name="column1" Type="Boolean" />
				<asp:Parameter Name="column2" Type="Boolean" />
				<asp:Parameter Name="column3" Type="Boolean" />
				<asp:Parameter Name="column4" Type="Boolean" />
				<asp:Parameter Name="column5" Type="Boolean" />
				<asp:Parameter Name="column6" Type="Boolean" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="State" Type="String" />
				<asp:Parameter Name="Zip" Type="String" />
				<asp:Parameter Name="Tel" Type="String" />
				<asp:Parameter Name="Email" Type="String" />
				<asp:Parameter Name="Wages" Type="Decimal" />
				<asp:Parameter Name="C_Over" Type="String" />
				<asp:Parameter Name="Comments" Type="String" />
				<asp:Parameter Name="Case_ID_Number" Type="Int32" />
			</UpdateParameters>
			<InsertParameters>
				<asp:Parameter Name="LName" Type="String" />
				<asp:Parameter Name="FName" Type="String" />
				<asp:Parameter Name="SSN" Type="String" />
				<asp:Parameter Name="Level" Type="String" />
				<asp:Parameter Name="Program" Type="String" />
				<asp:Parameter Name="Enroll_Date" Type="DateTime" />
				<asp:Parameter Name="Current_Activity" Type="String" />
				<asp:Parameter Name="Date_Activity_Began" Type="DateTime" />
				<asp:Parameter Name="ITA" Type="String" />
				<asp:Parameter Name="Tng_Inst" Type="String" />
				<asp:Parameter Name="Tng_Pro" Type="String" />
				<asp:Parameter Name="Date_Contact" Type="DateTime" />
				<asp:Parameter Name="CM" Type="String" />
				<asp:Parameter Name="Closure_Date" Type="DateTime" />
				<asp:Parameter Name="Closure_Reason" Type="String" />
				<asp:Parameter Name="End_Date" Type="DateTime" />
				<asp:Parameter Name="Hire_Date" Type="DateTime" />
				<asp:Parameter Name="Active" Type="String" />
				<asp:Parameter Name="TAA" Type="String" />
				<asp:Parameter Name="column1" Type="Boolean" />
				<asp:Parameter Name="column2" Type="Boolean" />
				<asp:Parameter Name="column3" Type="Boolean" />
				<asp:Parameter Name="column4" Type="Boolean" />
				<asp:Parameter Name="column5" Type="Boolean" />
				<asp:Parameter Name="column6" Type="Boolean" />
				<asp:Parameter Name="Address" Type="String" />
				<asp:Parameter Name="City" Type="String" />
				<asp:Parameter Name="State" Type="String" />
				<asp:Parameter Name="Zip" Type="String" />
				<asp:Parameter Name="Tel" Type="String" />
				<asp:Parameter Name="Email" Type="String" />
				<asp:Parameter Name="Wages" Type="Decimal" />
				<asp:Parameter Name="C_Over" Type="String" />
				<asp:Parameter Name="Comments" Type="String" />
			</InsertParameters>
		</asp:SqlDataSource>
		<br />
        
        
    </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:megnin
  • 31
  • 17
48 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34923066
Is there a <compilation> element in the web.config that points to C#?

compilation Element (ASP.NET Settings Schema)
http://msdn.microsoft.com/en-us/library/s10awwz0.aspx

 defaultLanguage="language"
0
 
LVL 1

Author Comment

by:megnin
ID: 34924508
Hi TLO,

No.  I was surprised at how small the web.config of the freshly created VS2010 project was (see above).  Here is the <compilation> element from it:
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
I'll try adding defaultLanguage="vb" to it explicitly, but that article show that vb is the default.

Hey, TLO, thank you for responding to my question.  I know that if anyone can help me get going on this, you can.  You've been a great help to me for several years now.  :-)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34926518
Is this a Web Site model (no project file), or a Web Application model web site (project file)?

The language is also specified in the .aspx pages:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

The web.config file in my web application has these entries:

	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="WarnAsError" value="false"/>
			</compiler>
		</compilers>
	</system.codedom>

Open in new window

0
 
LVL 1

Author Comment

by:megnin
ID: 34926708
There is a project file.  I think it's a Web Application model.

This was in that section of the original web.config created with VS 2008:
	<system.codedom>
		<compilers>
			<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="WarnAsError" value="false"/></compiler>
			<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
				<providerOption name="CompilerVersion" value="v3.5"/>
				<providerOption name="OptionInfer" value="true"/>
				<providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>

Open in new window

That particular section is not even in the web.config created with the fresh new project I created in VS 2010 then edited to add connectionString etc.

This is the first line of my .aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

Open in new window

I included the .aspx, .aspx.vb and web.config files above.
My Solution Explorer window with Reports project open
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34927926
There might be the way to get around this problem, but you may run into a different set of problems.  I would suggest creating a new VB.NET web application, and import the content pages into the application, instead of trying to make this all work.  That usually requires understanding the differences between the web.config between 2008 and 2010.
0
 
LVL 1

Author Comment

by:megnin
ID: 34927994
I'll give that a try with this web application.  I have about two dozen web applications on or Win 2003 Server that we are moving over to the new Win 2008 R2 server (in Xen Server).  

I have been (on 2003) using Visual Studio 2008.  Since we are upgrading the servers I was hoping to be able to start using Visual Studio 2010.  What would you suggest my plan for starting to use VS 2010 be?  It would be a pitty if I was unable to upgrade the web apps to .NET 4.0 and start taking advantage of the new features.  
0
 
LVL 1

Author Comment

by:megnin
ID: 34928268
Okay, to create a new VB.NET web *application* in VS 2010 I can select File / New / Project and then from the New Project dialog select an ASP.NET Web Project.

Or I can create a new ASP.NET web *site* by selecting File / New / Web site and then from the New Web Site dialog select ASP.NET Web Site.

Especially in VS 2010 I'm not sure if I need to create a web application or if a web site is what I should be using.

I guess I could experiment.  ;-)  Most of my projects are basically like the one in my question post.  They are either web forms, like a job application, you fill in the blanks and the data goes to SQL Server via ADO.Net or they have GridViews for accessing and changing the very same databases populated with the forms.  In the code behind page I sometimes put a bit, sometimes a lot of VB, always ADO.NET like the above Select procedure or an Insert procedure.

Does that require an *application* or would a *site* do just as well.  I guess I'm just not clear on the difference between the two.  (I know... Google is my friend.  I'll do that.)  ;-)
0
 
LVL 1

Author Comment

by:megnin
ID: 34928595
Okay, according to "Google" there are some differences about dynamic compiling and profiles... I'll keep using the web application model.  Okay, going to create a new one and import the content pages from the Reports web *application* and see what happens. ;-)
0
 
LVL 1

Author Comment

by:megnin
ID: 34929308
alright, I created a new ASP.NET Web Application in VS 2010, tested and explored it.  The login feature worked great.  

Then, I replaced the existing default.aspx and defaults.aspx.vb with the files from the Reports web application built in VS 2008.  I got build errors saying that the default.aspx.designer.vb file was missing. POC.

So, then I put the original default.aspx, default.aspx.vb and default.aspx.designer.vb back in and just copied the text from the Reports' default.aspx into the VS 2010 created default.aspx and the code text from the Reports' defaualt.aspx.vb file into the VS 2010 created default.aspx.vb file.  I figured the *.*.designer.vb file would update itself.  So, it's as if I created a new web application project in VS 2010 and just changed the markup and code to make the desired application.   You'd think it would just work.  Not Microsoft. Error ListI seriously think I'm just going to stay with VS 2008 forever.
0
 
LVL 1

Author Comment

by:megnin
ID: 34929455
I rebuilt the project and that got rid of errors 3, 4 and 5.  I CType() converted the DBCmd.ExecuteScalar, Dim varCount As Integer = CType(DBCmd.ExecuteScalar(), Integer) and that got rid of error #2.  It builds without erros, but when I run debug it it never opens in the browser. :-(
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34931490
Rust never sleeps!!  You have had fun, while I was busy with other things!!

My preference is to stay away from Web Site model web sites, since you don't have as much control over the process.  With web applications, you compile the web site into DLLs, and you can have multiple web sites in the same solution.  Working with files is different, since you can put the files into different folders, that Web Site model web sites don't like (hence App Data, App Themes, ... folders for predictable places to look for stuff).

I feel your pain, but it bothers me when someone says, "I seriously think I'm just going to stay with VS 2008 forever".  2010 has some serious enhancements over 2008, when it comes to language.  

What do the startup options look like on the Web tab in project properties?
0
 
LVL 1

Author Comment

by:megnin
ID: 34933066
Current Page is selected.
 Startup Options on Web tab
0
 
LVL 1

Author Comment

by:megnin
ID: 34933081
Oh, I seriously like VS 2010.  I'll cry if I can't use it for my existing (vs 2008) projects.  I would start any new projects with 2010.  I really hope I can get my existing projects to work in VS 2010.  Upgrading them to Framework 4.0 also would be nice but not critical.  I would be happy maintaining existing projects with VS 2010 / Framework 3.5 if that's possible.  Most of my web application projects are things I'm constantly working on and adding new "features" and just changing stuff as requirements from the users change.
0
 
LVL 1

Author Comment

by:megnin
ID: 34933102
Here's what I still have after copying the code from the old page into a new vs2010 page.   Page declaration errorI left the page declaration line from the newly created page in place and just copied the rest of the page from the vs2008 page.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34939132
If you are working with sites on IIS, I would suggest using IIS locally, since there are some compatability issues with the internal Cassini web server.  Also, I would suggest changing the Start Action to a specific page (i.e. Default.aspx).  You can set that in the Solution Explorer, by right-clicking on the page, and selecting Set as Startup Page.  It is a better option than Current Page.
0
 
LVL 1

Author Comment

by:megnin
ID: 34952724
I changed the Start Action to "Default.aspx", which should be the start page.  I also changed the Target Framework back to 3.5 as it should be.  The site was created in 3.5 with VS 2008.  

Now I'm getting "Failed to map the path '/'." error on the page declaration line.
0
 
LVL 1

Author Comment

by:megnin
ID: 34952804
That error was easy to find using Google.  I just had to fix the Application Pool.  I had it set to Default Application Pool.  I created a new one for this application and set it to that and it worked.
0
 
LVL 1

Author Comment

by:megnin
ID: 34952830
Well, actually that didn't fix the "Failed to map the path '/'." error.  The web page came up when I browsed to it, but I'm still seeing that error in VS 2010.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34953410
I really feel that you are in a configuration mix-up, and you are really feeling the pain.  When I come across that kind of issue, I really like to start clean.  

That would mean something like this:

1) Create a new web project (File | New | Project | Visual Basic | Web | ASP.NET Web Application).  Make sure that the correct framework is selected at the top of the dialog.

New Project Dialog -- New ASP.NET web application (.NET 4.0)
2) Copy all the required content files from the 2008 web application (.aspx, .aspx.vb, .ascx, .ascx.vb, etc.).  I would suggest not copying the web.config file, but merging the needed changes with the new 4.0 web.config file.  You noticed that the 4.0 web.config file has some significant changes.

3) Toggle the "Show All Files" option the Solution Explorer

 Solution Explorer -- Show All Files
4) Right-click on each file that you want to include in the project file, and select "Include In Project".  You should only need to add the top-level files (.aspx, .ascx, ...), the related files should be added automatically.

5) Change the project properties on the Web tab to target IIS.  Click on the <Create Virtual Directory> button to create the application on IIS.

Web Application properties -- Web tab
This "clean" approach still needs some hand-massaging, but the configuration should be closer to what you need.
0
 
LVL 1

Author Comment

by:megnin
ID: 34953471
Thanks, I'll give that a try.   I had attempted to copy the files into a new 4.0 project before, but I didn't have any steps to follow and I did not do some of the things you suggest.  
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34953496
There might be some additional steps that need to be added to that list, since I didn't actually go through all the necessary steps...
0
 
LVL 1

Author Comment

by:megnin
ID: 34953508
I'll do what you've outlined and let you know what happens.  I guess we can go from there.  ;-)
0
 
LVL 1

Author Comment

by:megnin
ID: 34953681
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34953787
What operating system are you running on?  It looks like you don't have all the pieces installed for IIS to work correctly on your local machine...
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 1

Author Comment

by:megnin
ID: 34953807
My local machine is Windows 7.  The new web server is Server 2008 R2.  The old web server was 2003 and I created the web page on Windows XP/VS 2008.

Do I only need to install that IIS 6 Configuration Compatibility on my local maching or on the server?
0
 
LVL 1

Author Comment

by:megnin
ID: 34953837
I guess it's on my local maching since it's already installed on the server... Installed on Server 2008 R2
0
 
LVL 1

Author Comment

by:megnin
ID: 34953899
When I got that error, I'm sure glad I pressed F1 for more information...
"Specifies that Visual Studio will run your application on the local IIS Web server instead of the Visual Studio Development Server."
0
 
LVL 1

Author Comment

by:megnin
ID: 34954207
Okay, I got the IIS 6 compatibility stuff installed on my local Win7 machine.  I'll see if I can copy the v3.5 files into this project...
0
 
LVL 1

Author Comment

by:megnin
ID: 34954425
Oh, my god.  What is up with this?
The page has two DropDownBoxes and a label.
All of them produce errors when I try to build the project:
'dlProgram' is not declared. It may be inaccessible due to its protection level.

I removed one of them and dragged a new DDL from the toolbox and still got the same error.  Is anyone actually able to use VS 2010?
2-22-2011ErrorOnLabel.png
0
 
LVL 1

Author Comment

by:megnin
ID: 34954706
Well, I put it back on the old server.  It can rot there.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34955292
If you haven't already figured that out, you need to install those pieces on your local machine, so that you can create web sites...
0
 
LVL 1

Author Comment

by:megnin
ID: 34955816
Yeah, from three posts up...
"Okay, I got the IIS 6 compatibility stuff installed on my local Win7 machine"
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34955864
What does the .Designer.vb file look like?

Example:

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated. 
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Partial Public Class _Default

    '''<summary>
    '''form1 control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm

    '''<summary>
    '''OuterRepeater control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents OuterRepeater As Global.System.Web.UI.WebControls.Repeater
End Class

Open in new window

0
 
LVL 1

Author Comment

by:megnin
ID: 34955954
I'm not sure, maybe it's because I moved it back to the Server 2003 server, I opened it in VS 2008 and VS 2010 and didn't see a *.Designer.vb file.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34956023
Start with a new VS.NET 2010 Web Application, and look to see if you have any .Designer.vb files...
0
 
LVL 1

Author Comment

by:megnin
ID: 34956074
In a brand new application it just looks like this:

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On



Partial Public Class _Default
End Class

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34956109
When you drop controls on the Default.aspx page, it should generate declarations for the controls in the .Designer.vb file.
0
 
LVL 1

Author Comment

by:megnin
ID: 34956192
It does:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated. 
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Partial Public Class _Default

    '''<summary>
    '''Calendar1 control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents Calendar1 As Global.System.Web.UI.WebControls.Calendar

    '''<summary>
    '''CheckBox1 control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents CheckBox1 As Global.System.Web.UI.WebControls.CheckBox

    '''<summary>
    '''Label1 control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents Label1 As Global.System.Web.UI.WebControls.Label

    '''<summary>
    '''ListBox1 control.
    '''</summary>
    '''<remarks>
    '''Auto-generated field.
    '''To modify move field declaration from designer file to code-behind file.
    '''</remarks>
    Protected WithEvents ListBox1 As Global.System.Web.UI.WebControls.ListBox
End Class

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34956289
This might be a great case for recreating the web pages...do you have master pages, content pages, CSS files, ...?
0
 
LVL 1

Author Comment

by:megnin
ID: 34956306
That's not happening.  I have two dozen sites that average a dozen .aspx pages each.  Most have external CSS and JavaScript files.  I don't have many with master pages.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34956344
Hint for recreating the web page:

1) Add a web page to the 2010 web application with the same name

2) Copy just the HTML between the <form> elements (not including the <form> element).

Example:

  <div>
    <asp:Repeater ID="OuterRepeater" runat="server">
      <ItemTemplate>
        <asp:Label ID="Name" runat="server" />
        <br />
        <br />
        <asp:Repeater ID="InnerRepeater" runat="server" OnItemDataBound="InnerRepeater_ItemDataBound">
          <ItemTemplate>
            <asp:Label ID="Title" runat="server" />
          </ItemTemplate>
        </asp:Repeater>
      </ItemTemplate>
    </asp:Repeater>
  </div>
  

Open in new window


3) Copy the code in the code behind .aspx.vb file (not including the class declaration):

Example:

 Private m_element As XElement

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then
            m_element = XElement.Load(Server.MapPath("Test.xml"))

            Session("Document") = m_element

            Dim query = From element In m_element...<Booking>
                        Where element.@CLIENT_NO = "SA33762"
                        Select element

            Me.OuterRepeater.DataSource = query
            Me.OuterRepeater.DataBind()

        Else
            m_element = TryCast(Session("Document"), XElement)
        End If

    End Sub

    Protected Sub OuterRepeater_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles OuterRepeater.ItemDataBound

        If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
            Dim nameLabel As Label = TryCast(e.Item.FindControl("Name"), Label)

            If nameLabel Is Nothing Then
                Throw New NullReferenceException("Cannot find Name label")
            End If

            Dim dataElement As XElement = TryCast(e.Item.DataItem, XElement)

            If dataElement Is Nothing Then
                Throw New NullReferenceException("Invalid control state--cannot get XElement from DataItem")
            End If

            nameLabel.Text = "Name:  " & dataElement.<NAME>.Value

            Dim innerRepeater As Repeater = TryCast(e.Item.FindControl("InnerRepeater"), Repeater)

            If innerRepeater Is Nothing Then
                Throw New NullReferenceException("Cannot find inner Repeater")
            End If

            Dim query = From title In dataElement...<TITLE>
                        Select title

            innerRepeater.DataSource = query
            innerRepeater.DataBind()

        End If

    End Sub

    Protected Sub InnerRepeater_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)

        If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
            Dim titleLabel As Label = TryCast(e.Item.FindControl("Title"), Label)

            If titleLabel Is Nothing Then
                Throw New NullReferenceException("Cannot find Title label")
            End If

            Dim dataElement As XElement = TryCast(e.Item.DataItem, XElement)

            If dataElement Is Nothing Then
                Throw New NullReferenceException("Invalid control state--cannot get XElement from DataItem")
            End If

            titleLabel.Text = "Title:  " & dataElement.Value

        End If

    End Sub

Open in new window

0
 
LVL 1

Author Comment

by:megnin
ID: 34956419
I'll try that on a smaller site.  

This past weekend we installed Xenserver on two new servers and installed Windows Server 2008 R2 in several VMs, then Exchange 2010, SQL 2008 R2 and, of course Server has IIS 7.5.  Then we migrated, copied, imported and otherwise ferried everything from our Windows 2003 Server boxes to the VMs.  We are now fighting with all the issues were Microsoft is not compatible with itself or there are fundamental changes in configurations between the two server versions.  I need sleep and this VS 2010 is just p*****g me off.  Exchange mailboxes are still copying over... ;-)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34956447
I feel your pain, and I will try to help where I can...I realize that recreating/reengineering is prohibitive, but it is sometimes the "cleanest" option...
0
 
LVL 1

Author Comment

by:megnin
ID: 34960428
New day, got some sleep... ;-)  I am definitely in favor of clean solutions even if it's a bit more work.  Unfortunately, business doesn't stop and wait for me, so I have to find a happy balance between what I want and should do and what I have to do to keep people working.

Could we take a step back and perhaps a higher viewpoint and look at the process or "Best Practice" in general for migrating a VS 2008/3.5 Framework/IIS 6 web application to VS 2010/3.5 or 4.0 Framework/IIS 7.5?  Once I understand the basic configuration differences and what needs to happen or be installed or configured for one site then I can get them all going.

One requirement is that the sites have to run in IIS 7.5/Server 2008 R2.  The 2003 server is going away.  I would *like* to continue to work on existing sites in VS2010.  Upgrading them to Framework 4.0 would be nice, but if it's difficult, existing web applications can stay at 3.5.  If it's not practical to even be able to work on them in VS 2010, then I can install VS 2008 on this Windows 7/x64 machine and use it to work on existing sites and just create any new ones in VS 2010.  Working on some of the ones I have to work on daily would sure be nice if I could use vs 2010 though.  I really appreciate any help or advice you can provide.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34973929
The question for the day is, "Did these web sites start as 2008 web applications, or did they start as 2003/1.1, and get migrated up the versions?"...
0
 
LVL 1

Author Comment

by:megnin
ID: 34974543
Some may have started as 2005/2.0 sites.  I've never used vs2003.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 34974702
1) I don't have any resources, nor can I find any that address migrating a web application from 2008 to 2010.

2) There are resources that talk about migrating a web site to a web application, but that's a different story.

3) If you had a 2005 web application, I was under the impression that is used .Designer files, so I don't know why they don't exist for you.

4) I am trying to find a way for you to upgrade to 4.0 cleanly.
0
 
LVL 1

Author Comment

by:megnin
ID: 34989259
Thank you very much.  

I'm surprised there isn't more information on upgrading a web application from 2008 to 2010.  It seems like it would be a commonly done migration.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now