Click here to Skip to main content
15,888,008 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Can I Bind method to the control? Pin
Brij18-Apr-10 7:58
mentorBrij18-Apr-10 7:58 
QuestionIssue with WebToolBox.DatePicker... Pin
<<Tash18>>18-Apr-10 3:39
<<Tash18>>18-Apr-10 3:39 
AnswerRe: Issue with WebToolBox.DatePicker... Pin
Sandeep Mewara18-Apr-10 5:26
mveSandeep Mewara18-Apr-10 5:26 
QuestionForcing full postback in UpdatePanel Pin
paper6718-Apr-10 3:04
paper6718-Apr-10 3:04 
AnswerRe: Forcing full postback in UpdatePanel [modified] Pin
daveyerwin18-Apr-10 4:42
daveyerwin18-Apr-10 4:42 
GeneralRe: Forcing full postback in UpdatePanel Pin
paper6718-Apr-10 8:57
paper6718-Apr-10 8:57 
GeneralRe: Forcing full postback in UpdatePanel Pin
daveyerwin18-Apr-10 12:11
daveyerwin18-Apr-10 12:11 
QuestionInvalid column names in asp.net application with sql server Pin
Lessobvious18-Apr-10 0:48
Lessobvious18-Apr-10 0:48 
Hello,

I have been creating a simple gridview in an asp.net application connected to sql server. Everthing works fine on the local development site, when I deploy I get the following error.

Invalid column name 'ClientID'.
Invalid column name 'ContractorID'.
Invalid column name 'ProjectType'.
Invalid column name 'HideProject'.
Invalid column name 'StartOnSite'.
Invalid column name 'Completion'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'ClientID'.
Invalid column name 'ContractorID'.
Invalid column name 'ProjectType'.
Invalid column name 'HideProject'.
Invalid column name 'StartOnSite'.
Invalid column name 'Completion'.

The gridview has been created using visual studio 2008, without modification, and points to a view based on 3 tables. I have re-created both the gridview and tables several times. The view was scripted from the local sql server on the remote server, using Create View with SET QUOTED_IDENTIFIER ON and also turned off. I have removed all parameters, so theres nothing that could trip up the query. The query runs fine on the remote server when I look at it with Management Server. I have also tried changing all the fields on the gridview to template fields, so I can see the bindings and check for upper and lower cases, and everything is fine. I have checked through lots of articles and this is usually due to missing columns on the view or table, or upper and lower cases in the mark up; but they are all fine and work in the development environment?
This is driving me mad. Since the view runs on the server without problems, it must be the asp.net gridview thats tripping out. But I can't see it.

Here is the gridview markup.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" <br />
    BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" <br />
    CellPadding="3" CssClass="menutxt" DataKeyNames="ProjectID" <br />
    DataSourceID="ProjectListing" GridLines="Vertical"><br />
    <RowStyle BackColor="#EEEEEE" ForeColor="Black" /><br />
    <Columns><br />
        <asp:BoundField DataField="ProjectID" HeaderText="ProjectID" ReadOnly="True" <br />
            SortExpression="ProjectID" /><br />
        <asp:BoundField DataField="ClientID" HeaderText="ClientID" <br />
            SortExpression="ClientID" /><br />
        <asp:BoundField DataField="ProjectName" HeaderText="ProjectName" <br />
            SortExpression="ProjectName" /><br />
        <asp:BoundField DataField="ContractorID" HeaderText="ContractorID" <br />
            SortExpression="ContractorID" /><br />
        <asp:BoundField DataField="ProjectType" HeaderText="ProjectType" <br />
            SortExpression="ProjectType" /><br />
        <asp:BoundField DataField="Description" HeaderText="Description" <br />
            SortExpression="Description" /><br />
        <asp:CheckBoxField DataField="HideProject" HeaderText="HideProject" <br />
            SortExpression="HideProject" /><br />
        <asp:BoundField DataField="StartOnSite" HeaderText="StartOnSite" <br />
            SortExpression="StartOnSite" /><br />
        <asp:BoundField DataField="Completion" HeaderText="Completion" <br />
            SortExpression="Completion" /><br />
        <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" <br />
            SortExpression="CompanyName" /><br />
    </Columns><br />
    <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /><br />
    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /><br />
    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /><br />
    <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /><br />
    <AlternatingRowStyle BackColor="#DCDCDC" /><br />
</asp:GridView><br />
<asp:SqlDataSource ID="ProjectListing" runat="server" <br />
    ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>" <br />
    SelectCommand="SELECT [ProjectID], [ClientID], [ProjectName], [ContractorID], [ProjectType], [Description], [HideProject], [StartOnSite], [Completion], [CompanyName] FROM [About_VProjectList]"><br />
</asp:SqlDataSource>


What school boy error am I making that I just can't see?
AnswerRe: Invalid column names in asp.net application with sql server Pin
Not Active18-Apr-10 1:07
mentorNot Active18-Apr-10 1:07 
GeneralRe: Invalid column names in asp.net application with sql server Pin
Lessobvious18-Apr-10 2:35
Lessobvious18-Apr-10 2:35 
GeneralRe: Invalid column names in asp.net application with sql server Pin
Brij18-Apr-10 6:25
mentorBrij18-Apr-10 6:25 
AnswerRe: Invalid column names in asp.net application with sql server Pin
preetpal kapoor7-Jun-11 5:54
preetpal kapoor7-Jun-11 5:54 
Questionradio button list problem [modified] Pin
SreejithKumar M18-Apr-10 0:00
SreejithKumar M18-Apr-10 0:00 
AnswerRe: radio button list problem Pin
Brij18-Apr-10 0:22
mentorBrij18-Apr-10 0:22 
AnswerRe: radio button list problem Pin
Abhijit Jana18-Apr-10 0:53
professionalAbhijit Jana18-Apr-10 0:53 
QuestionRedirection To Page Issue. Pin
VikashGohil17-Apr-10 21:58
VikashGohil17-Apr-10 21:58 
AnswerRe: Redirection To Page Issue. Pin
dan!sh 17-Apr-10 22:06
professional dan!sh 17-Apr-10 22:06 
GeneralRe: Redirection To Page Issue. Pin
VikashGohil18-Apr-10 23:28
VikashGohil18-Apr-10 23:28 
AnswerRe: Redirection To Page Issue. Pin
Chetan Patel18-Apr-10 0:40
Chetan Patel18-Apr-10 0:40 
GeneralRe: Redirection To Page Issue. Pin
VikashGohil19-Apr-10 6:39
VikashGohil19-Apr-10 6:39 
GeneralRe: Redirection To Page Issue. Pin
Chetan Patel1-Oct-11 23:12
Chetan Patel1-Oct-11 23:12 
Questionsession active and close the browser without login off... Pin
Sasmi_Office16-Apr-10 23:41
Sasmi_Office16-Apr-10 23:41 
AnswerRe: session active and close the browser without login off... Pin
Parwej Ahamad17-Apr-10 1:13
professionalParwej Ahamad17-Apr-10 1:13 
AnswerRe: session active and close the browser without login off... Pin
Abhijit Jana17-Apr-10 2:39
professionalAbhijit Jana17-Apr-10 2:39 
Questionhow to access a label in gridview Pin
prasadbuddhika16-Apr-10 21:40
prasadbuddhika16-Apr-10 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.