gns1497's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
New Members
Active Posts:
11 (0.01 per day)
Joined:
27-June 12
Profile Views:
359
Last Active:
User is offline Nov 13 2013 03:35 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   gns1497 has not set their status

Posts I've Made

  1. In Topic: Having problem reading from sql server view

    Posted 9 Oct 2013

    View Postandrewsw, on 07 October 2013 - 12:32 PM, said:

    The error message should give you some indication of where the error is. I don't use ASP.NET but assume you can press Break, or similar, and it will take you to the error.

    The error message itself suggests that you have a missing, or extra, bracket, or some similar simple syntax error which shouldn't be too difficult to spot.

    BTW What's all this..

             
                       &
    

    Eek! :dontgetit:/> Use css if you want to separate elements.



    The   was auto written using the .net suite. I didnt write that code. This is just page spacing however, and is not of concern. I really dont care about that. My concern is getting the query to work and displaying the datagrid. I can tweak html later if necessary.

    I'm afraid this is more complicated than an extra bracket. This very same query works fine when I run it in SQL Server Management Studio directly against the database. For whatever reason, it doesnt like the line below.

    sqlRead = sqlCmd.ExecuteReader()
  2. In Topic: Having problem reading from sql server view

    Posted 7 Oct 2013

    View Postybadragon, on 07 October 2013 - 09:31 AM, said:

    What is the error you get?


    SqlException was unhandled by user code (title bar of error in debug mode vs.net. "Incorrect syntax near ')'."
  3. In Topic: Unable to update or delete records from SQL 2008 database

    Posted 16 Aug 2012

    View PostNakor, on 19 July 2012 - 04:33 PM, said:

    SELECT [fldAppName] as 'Application', [fldGroupName] as 'Group Name', [fldAppSymID] as 'Symposium ID', 
           [fldAppPhone] as 'Phone', [fldAppPhoneOpt] as 'Options' 
    FROM [tblApplication] 
    WHERE ([fldGroupName] = @fldGroupName) ORDER BY [fldAppName]
    
    


    You're giving an alias to your columns. The boundfields will be looking for the alias name not the real column name. You would need to bind to "Application" instead of "fldAppName". Either that or remove the aliases.




    Thanks for all the help, Nakor. I found that once I changed this to use the Alias it worked, but took me back to the original error that I mentioned in the first post of this thread. After much use of Google :) I found this was being caused by the spaces in my alias'. Once I replaced the spaces with underscores...voila. I actually ended up removing all of the alias' and manually defining my columns in the gridview and setting the "HeaderText" property with what I wanted them to display as. The worked perfectly. Thanks again for your help.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

gns1497 hasn't added any friends yet.

Comments

gns1497 has no profile comments yet. Why not say hello?