Not able to use sql Convert function in gridview

 Hi!

Im trying to get europe time in one of my gridviews (instead of am/pm format), and tryed using following select-string:

SelectCommand="SELECT Convert(DateTime, vagt.start, 13), vagt.***, medarbejder.fornavn + ' ' + medarbejder.efternavn AS Expr1, medarbejder.medarbejder_id, vagt.vagt_id FROM vagt INNER JOIN medarbejder ON vagt.medarbejder_id = medarbejder.medarbejder_id WHERE vagt.dags_id = @intDagsid"

 The thing to note ofc, is the Convert() part. Now, when i use that method on the "vagt.start" column, it gives me an error stating it cant fint a field or property with the specified name. The above select-string works fine without the Convert() method around vagt.start.

Any ideas?

0
Fireblast
10/14/2008 12:31:20 PM
asp.net.web-forms 93655 articles. 4 followers. Follow

2 Replies
486 Views

Similar Articles

[PageSpeed] 27

you have to give alias columnname to it like below

 SelectCommand="SELECT Convert(DateTime, vagt.start, 13) as start,vagt.***, medarbejder.fornavn + ' ' + medarbejder.efternavn AS Expr1, medarbejder.medarbejder_id, vagt.vagt_id FROM vagt INNER JOIN medarbejder ON vagt.medarbejder_id = medarbejder.medarbejder_id WHERE vagt.dags_id = @intDagsid"


Give a man a fish and you feed him for a day. Teach a man to fish and you feed him forever.
0
ramireddyindia
10/14/2008 12:42:15 PM

 Worked perfectly:) Thx

0
Fireblast
10/14/2008 1:31:14 PM
Reply:

Similar Artilces:

Converting a gridView using an Sql Datasource to a gridview who is not using an SQL DataSource
How can i rewrite this page so that i doesnt make use of an SqlDataSource?  <%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoginHistory.ascx.cs" Inherits="Private_UserControls_WebUserControl" %> <html> <head> <%--<link rel="stylesheet" href="BaldwinPortal.css" mce_href="BaldwinPortal.css" type="text/css" />--%> <title>Login History</title> </head> <body style="margin:0 0 0 0;padding:0 0 0 0"> ...

4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C#
4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C# . Can someone provide with code as I am new to this architecture and framework. Better send email. Thanks In Advance, A New Bie I suggest taking a look at the Time Tracker Starter Kit (v1.x or x2.0) or the Issue Tracker Starter Kit (v1.x).  Full source code is available.  Click on the Downloads tab above to find them.  These are not exactly what you are looking for, but perhaps they will help you get started.Terri MortonEngagement Manag...

How to connect PB .NET Web Forms to MS SQL 2005 via SNC using "Windows Authentication"?
Dear All, I have a PowerBuilder native client / server application which connects fine to the Microsoft SQL Server 2005 back-end database via the SNC native driver using "Windows Authentication" (NOT "SQL Server Authentication"). The corresponding program code being used is as shown below: ///////////////////////////////////////////////////////////////////////////////////////////////////////// String ls_userid, ls_password ls_userid = sle_id.Text ls_password = sle_password.Text IF Len(ls_userid) <> 0 AND Len(ls_password) <> 0 THEN // Pro...

How do I use the public function I clarified in Master Page, and use it in other web forms?
I have written a public function in Master Page's Code File, and would like to use it in other web form while i would like to get the label out of the function return. Mark up: I have placed the ClassName ="MasterPage" in Master Page's <%@  Master.. ClassName="MasterPage" %> I have placed <%@ MasterType TypeName="Site.Master" in Web form used (or should i use VirtualPath instead?) Error : BC30456: 'RetrieveLanguageText' is not a member of 'System.Web.UI.MasterPage'. Main.Master.vb (Site.Master'...

How To Convert c#2005.net web template to vb2005.net Forms Template
I need  Convert c#2005.net web template to vb2005.net Forms Template   There are some free c# to vb converters out there which will allow you to upload a project and convert it to vb.   The programming models for windows forms and web projects are very different there is no way to convert a web to windows forms project.   http://www.carlosag.net/Tools/CodeTranslator/Default.aspx      Silverlight-helpVb TipsSpace Coast .Net User Group Hey Ajax-y, This tool really helps all programmers. I thought I would share this wit...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

Converting windows application using web service from Visual C#.net 2003 to Visual Studio.net 2005
Hello, everyone! I have a solution which contains a windows project,a web service project and several other library projects. These projects were coded under visual c#.net 2003. Now I need to converted them to use Visual Studo.net 2005. Does any one know any article providing step-by-step guide  to converting WINDOWS APPLICATION with web service? I can find one under MSDN for converting web project.  But I guess I am a little confused if mine should follow this article since I am using web service in my windows application? Thanks a lot in advance.  ...

can someone one give me difference between web form and mobile web form and which or where or when i'm using the forms?
thanks Marc Hi Marc, Based on my understanding, you want to know the differences between the ASP.NET web application and ASP.NET mobile web application. If I have misunderstood you, please feel free to let me know. The ASP.NET forms are used to develop the ASP.NET pages for desktop browsers and The ASP.NET mobile forms are used to develop the ASP.NET pages for mobile device browsers. When we create the ASP.NET mobile web forms pages, we can use nearly all the features of ASP.NET. But there are a couple of compatibility issues: Error Handling and Reporting. Tracing. Using Redi...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Converting XSD to GridView Formate AND GridView to Xml convertion in.net 2005
hi...           I am new to .net 2005.My problem is        1.I have XSD . in that i am having Entair fields in that               2.i want to convert into Table form.        3.then i want to insert values in that table.        4.Finally i want to convert values in XML formate that's it.. it is very easy in .net 2003.note:-i dont want to use any code.every thing can do with in built ...

Need Windows Form to Retrieve Information From Web Form
I have a cash and carry web site that customers can order products, the next day come in to the company to pay and pickup. I would like to create a windows application for the company to do two things: 1. download all the orders from the day before 2. upload price changes, product changes, category changes I've search the internet and forums and the only thing I can find that I think would actually link these two together would be a web service. Can you please tell me if I am heading in the right direction or if there is another method to link the two applications, if there are any pitf...

Functions in Web Pages using VB.NET
Does anyone know where to place a FUNCTION with WEB Programming using VB.NET code behind? For example, if I have 4 ASPX pages and will use the same function, where or what part of the web page can I place this function or do I need to have that function in each of the ASPX page? Unlike in a COM program using VB.NET, that function would most probably reside in the MODULE and any VB.NET form can easily call it. TIF you can put it in a class***********************Dinakar NethiLife is short. Enjoy it.*********************** Thanks....

Converting an existing function in a Web Form into a Class
How do I take a Function that has been created in a Web form, and make it availabe to all other projects.  I assume that I have to create a new class, and then add it as a namespace.  Is that correct? Yes.. also move it to a library dll so that it can easily be referenced in other projects Jeev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If you get the answer to your question, please mark it as the answer....

converting PowerBuilder app to .NET web forms
Hello Version 11.1 build 8123/sql server. We access PowerBuilder through SoftGrid. We are planning on converting our pb apps to .net web forms. We need IIS on our development server. We cannot have IIS installed on our desktops. How would I go about explaining to our IT dept how we need IIS installed for us to proceed with .NET? Second Question: We also need the Microsoft .NET Framework 2.0. Is this also something that would typically be installed on individual desktops? any help would be greatly appreciated Sincerely Tony With 11.1, you have the option of deploying to an...

Web resources about - Not able to use sql Convert function in gridview - asp.net.web-forms

Wave function - Wikipedia, the free encyclopedia
... (a ball attached to a spring ) in classical mechanics (A-B) and quantum mechanics (C-H). In quantum mechanics (C-H), the ball has a wave function ...

TV binging, exercise skipping linked to poor cognitive function
... their fit, less TV-addicted counterparts. In particular, couch potatoes had slightly lower brain processing speeds and worse executive function, ...

Learning F# – The Thunderdome Principle for Functions
... One object enters, one object leaves! What I like about F# is that the language designers took a similar approach when they implemented functions. ...

HPE Offers Catalog of Virtual Network Functions for Telcos
The vendor's OpenNFV Solution Portal gives carriers a single place to find a range of VNFs that are pre-tested to run on their networks.

7 Useful Technical SEO Functions For Your E-commerce Website
This article was co-authored by Mate Dyekiss, SEO Strategist at IMI. An e-commerce website can create all the technical SEO issues onecan imagine: ...

Using AWS Lambda functions to create print ready files
... going to tell you about our processing architecture as well as at a recent performance improvement with the integration of AWS Lambda functions. ...

Political row over omitting Kerala CM from PM Modi’s function
Kerala chief minister Oommen Chandy on Saturday decided to keep away from Prime Minister Narendra Modi’s function in Kollam in south Kerala after ...

Colorado governor: This Planned Parenthood shooting may be a function of inflammatory rhetoric from bloggers ...
Via Grabien , skip to 4:45 of the clip below for the key bit. I naively thought we were (mostly) done with “climate of hate” stupidity after ...

Surprise: Binge-Watching TV May Cause a Decline in Brain Function
With the second season of Transparent only a few days away, some bad news awaits us: According to a recent study and common sense, probably, ...

Power Through Your Work With a “Forcing Function”
... to flow faster and more easily when I know I only have a couple of hours to turn it in. Entrepreneur Dan Martell calls this a “forcing function” ...

Resources last updated: 1/13/2016 9:08:34 PM