SQL Server :: Loosing Milliseconds In A Query?

Oct 11, 2010

i have a datetime column which has dates with milliseconds, but when i make a query and try to read that column i get the correct datetime but without dhe milliseconds.

I use a conversion like this: DateTime oColumn =DateTime.Parse(oRow["Start"].ToString());

Is there anyway to get the milliseconds from the column.

View 1 Replies


Similar Messages:

Asp.net - Displaying Milliseconds When Retrieving From DB

Jan 28, 2011

in my db i have:

2011-01-28 12:03:46.223


when displaying on .aspx page,

<%# Eval("ModifiedDateTime") == null ? " " : Eval("ModifiedDateTime")%>


it displays on the grid like this:

12/2/2010 8:43:18 AM


how do I format it like the default format shown when I query my db?

View 1 Replies

C# - Eval/Bind TimeOfDay Property Without Milliseconds?

Oct 19, 2010

I'm trying to format the following:

<%# Bind("TimeOfDay","{0:HH:mm:ss}") %>
<%# Eval("TimeOfDay","{0:HH:mm:ss}") %>
<%# Bind("TimeOfDay","{0:HH:mm:ss tt}") %>

[code]...

View 1 Replies

DataSource Controls :: Omitting The Milliseconds In A Date?

Feb 11, 2010

When I select from SQL Server, I want to get a date, but omit the millisecond value, and I want it to be as a date type. So if I have a value 1/1/2009 1:23:11.923, I want to omit the millisecond but retain the date type, so that it will be the value 1/1/2009 1:23:11.000 (I know you really can't omit the millisecond value with a date, just want it to be zero).

Is there a function in SQL Server to do this? Or do I have to write my own function? Again, I don't want it as a varchar type, but a datetime type.

View 2 Replies

DataSource Controls :: Can't Find Query's / By Right Clicking On Database Created A Query In Server Explorer?

May 17, 2010

By right clicking on my database i created a query in server explorer. But where are this query stored can't find them back. I should aspect that their is a folder query's like there is a folder tables but this isn't the case.

View 10 Replies

SQL Server :: Sub Query In Cross Table Query To Create Statistics

Mar 2, 2011

I am trying to create statitics for game downloads and am having dificulty with a sub part of my query. the goup by command is not having the disired result and i think i have been looking at it too long to see what i am doing wrong. [Code]....

At the moment it is producing each result in many rows when only 4 rows should appear. its the download column that is doing it. needs to be sub queried or something to display total in relation to month,gameid,userid.

Month-download-GameID-UserID

1 1
1 1

1 1
1 1

View 2 Replies

SQL Server :: Query Slow In Loading / Trying To Display Query Result?

Feb 1, 2011

I am trying to display this query result in an aspx page.

It is very slow in loading. Here is the query. The inner query inside the outer quesry is the problem.(Please see the underlined part in the query) - (If I remove that part it is very fast.)

select

top 500

--This column is the issue
,Governing_Class=( case when exists (select top 1 tqc.class_code from
t_quote_class tqc
inner join t_quote_class_premium tqcm on tqc.class_code =tqcm.
class_code
where tqc.appid=pi.appid and tqc.class_code not in('8742' ,'8810','7380')
order by tqcm.premium_amt desc
)
then ( select top 1 tqc.class_code from
t_quote_class tqc
inner join t_quote_class_premium tqcm on tqc.class_code =tqcm.
class_code
where tqc.appid=pi.
appid
order by tqcm.premium_amt desc
)
......... From tables

View 7 Replies

Databases :: Oracle Query Convert To Sql Server Query

Sep 3, 2010

I am a biggner in SQL DB . but i started a complicated and painfull work in SQL SERVER 2008. the problem convert Oracle hierarchical query to SQL query. the query

SELECT DISTINCT
LEVEL LVL,
SCH.NSCHEDULE_SL,
SCH.NSCHEDULE_SL_FM,
SCH.CSHED_CNAME
FROM FA_SCHEDULES SCH
WHERE LEVEL = 1
AND NSCHEDULE_SL_FM IS NULL
AND NBRANCH_SL = 2
CONNECT BY PRIOR SCH.NSCHEDULE_SL_FM = SCH.NSCHEDULE_SL
AND NBRANCH_SL = 2

View 1 Replies

Keep Loosing Application Settings?

Apr 15, 2010

I'm having a weird problem with one of my .net windows applications. I store a number of settings in the application settings (User Scope) but from time to time the settings just seem to dissapear when it's run on the server.

View 3 Replies

Multiple Webservice Calls / Some Of Its Calls Are Duplicated (with Difference Of Milliseconds)

May 10, 2010

I have a webservice (ASP.NET) deployed on a webfarm. A client application consumes it on daily basis. The problem is that some of its calls are duplicated (with difference of milliseconds). For example I have a function Foo(string a,string b). The client app calls this webmethod as Foo('test1','test2') once but my log shows that it is being called twice or sometimes 3 or 4 times randomly. Is this anything wrong with the webfarm or the code? Note that the webmethod has simple straighfarward insert and update statements.

View 1 Replies

Web Forms :: Loosing Values Between Postbacks?

Jun 30, 2010

I have a page, where I dynamically add textboxes within an updatepanel with a button.click event. Those are common telephone, fax, email, etc.. Now I put in some values, store those in Session with Arraylist and go to next page. Here, there is a button to go back to previous page. Ive managed to recreate all those textboxes on Page_Load event, using if not page.ispostback, then.. Now, this problem is driving me crazy. When I load my page, put in some values, add as many textboxes, as I want and go "Next", its ok. Then I go "Back" and everything is recreated and I see as many values within textboxes, that I created. But when I do this for a 2nd time, I can only see recreated textboxes without values. Ive spent some time searching for a simple solution, or an advice. But with no success. I could post some code here, but its a bit long and complicated. But if necesarry, I will.

View 4 Replies

SQL Server :: How To Copy Result Query To Another Query

Nov 4, 2010

i have tow query in one stored procedure

first query and the second one every of them return only value

i want to copy the result of tow values in a new row in new table

as i want to check on this tow values in ado.net

i want to get only this tow values as a row not first and secon query

only a row has result of first and second query results

[Code]....

View 3 Replies

SQL Server :: Select Second Query If First Query Returns Nothing?

Oct 14, 2010

How can I SELECT second if first SELECT returns nothing?

View 8 Replies

Update Panel - Controls Loosing Events?

Mar 22, 2010

I basically have an update panel being dynamically populated with a LinkButtons after a postback. This link buttons are being assigned an event. Now when I click the button the event is not firing. As I understand it the event is not firing because I'm not creating the button in the Page_Load event and therefore .Net does not remember this controls were created after postback. I'm not able to create these controls in the Page_Load as they are dependant on user input. So my question is how can I create these controls dynamically and have the page retain them and their events after postback?

View 4 Replies

UserControl, ViewState And Loosing Property Values?

Mar 29, 2011

this is about ASP.NET, ViewState, UserControls and loosing the values of my properties. It is an classic question by know, I know, and even though I have searched here and on Google for a resolution to this problem, I havent succeeded. On the contrary, the more I test different things, the less I understand it seems.

On top of this I am using ext.net and their so called DirectMethod's but I dont think that has much to do with this problem. There are numerous questions I have and I hope that this text will be fairly readable and understandable =)

The UserControl

I have a UserControl, Customers.ascx, that contains some Properties. The "most" important is *_CustomerId*. The _CustomerId is set in code-behind, in ext.net's "DirectMethod" like this (code below from the Page Customers.aspx):

[code]....

View 1 Replies

State Management :: Loosing Certain Sessions With Codebehind

Feb 9, 2011

I have a asp.net page with a codebehind. I have 2 buttons on the page. When clicking on button 1 I get some data from my database and save it for later use in Sessions.

[Code]....

View 4 Replies

Web Forms :: Loosing Values In Form On Insert Attempt?

Oct 26, 2010

I have a page with an asp:FormView. When I attempt an insert and it fails I loose the data in the form. ViewState is enabled.

<asp:FormView ID="frm_Person" runat="server" DataKeyNames="Person" DataSourceID="ds_edit_Person" DefaultMode="Insert" ViewStateMode="Enabled">

I am trapping the error on the datasource with

<asp:SqlDataSource ID="ds_edit_Person". oninserted="ds_Edit_Person_Sql_Event" onupdated="ds_Edit_Person_Sql_Event".

(ErrorHandler is just a static lookup function):

protected void ds_Edit_Person_Sql_Event(object sender, SqlDataSourceStatusEventArgs e) {
if (e.Exception != null) {
SqlException sqlex = (SqlException)e.Exception;
lbl_Error.Text = ErrorHandler.TranslateError(sqlex.Number);
e.ExceptionHandled = true;
}
else {
lbl_Error.Text = ErrorHandler.TranslateError(0);
gv_Person.DataBind();
}
}

How do I keep the values in the form?

View 7 Replies

How To Convert Gridview So It's Displayed As Either Yes Or No Without Loosing Underlying Values

Nov 11, 2010

I've created a gridview and one of the columns displays a field called "usegolive". In the table this value is either 1 or 0.I'd love to know how to convert this so it's displayed as either "yes" or "no" without loosing the underlying values. Seems fairly straightforward but I cant figure it out.

<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("usegolive") %>'></asp:Label>
</ItemTemplate>

View 4 Replies

Visual Studio :: Loosing Div Ids When Copying Html Syntax?

Sep 23, 2010

If I was to copy and paste the syntax below

<div
id="FabricSearchFabricSupplierText"><div>

it would come out as

<div
id="Div1"><div>

How do I stop it being changed to Div1?

I have looked under Tools | Options

I obvioulsly reuse my divs style definitions.

View 2 Replies

Web Forms :: Go Back To The Previous Page Without Loosing Searching Criteria?

Oct 18, 2010

I'll try to specify my problem as simple as possible! I have a problem comunicating between 2 pages; Products.aspx and ProductDetail.aspx. On Products.aspx i have about 15 DDL's on the left side (all set to autopostback), and 1 ListView ond the right side. Results in my ListView control are based on selcted items from DLL's on the left. Every single result in Products.aspx has a dynamical hyperlink to the ProductDetail.aspx. Now when I click on specific product in ListView I'm redirected to ProductDetail.aspx page, and everything works fine! If I click on the Back button in IE or FF it works also fine because it returns me to the previous Products.aspx page and all my results based on selected items in DDL's are still there!

The problem comes when causing some more autopostback's in ProductDetail.aspx page, because every autopostback is counted as a new page request and therefore i have to click Back button in IE or FF for more then 1 time to come back to the previous Products.aspx page.

I tried to implement code BELOW in ProductDetail.aspx.vb but it does not completly fulfill my expectations, becase all my searching criteria are lost when returned to the previous page (Products.aspx)

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("ReferrerUrl") = Request.UrlReferrer.ToString
End If
End Sub
Protected Sub BACK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BACK.Click
Response.Redirect(ViewState("ReferrerUrl").ToString)
End Sub

Does anybody knows any other solution how to come Back to previous page with only ONE CLICK without loosing searching criteria?

View 5 Replies

Web Forms :: Treeview State / Loosing Selected Node After Navigate?

Feb 5, 2010

Am new to asp.net.I am creating a site using asp.net(C#), in master page i have treeview control, when i select a item i navigate to url. But selected node is lost, it reset itself, loosing state.

View 4 Replies

State Management :: Webcontrol Loosing Viewstate Information During Postbacks?

Feb 5, 2011

I am having tough time finding out this reason. I have a web control where i add some variable in viewstate. like viewstate["test"] = "1".

when i post back this viewstate no more exists in collection.

[Code].....

View 1 Replies

Web Forms :: To Force A Page To Refresh Without Loosing VIEWSTATE Information?

Jul 19, 2010

I have an ASP.Net site that has master pages. The master page has some calls to functions to get information from a database. Then in one of the parts of the master page I have form that modifies that information. So when the user clicks a button the information in the database is updated but the display of that information doesn't update until the page is refreshed or another link is followed.

I would like to know how to force a page to refresh without loosing VIEWSTATE information so that the newly updated data in the database will appear correctly on the screen.

View 7 Replies

C# - JavaScript PageMethods Call Loosing HttpContext.Current State?

Dec 29, 2010

I am using JavaScript's PageMethod functionality where I am invoking a PageMethod which works like a gem. However I am having an issue in accessing the HttpContext's state which returns me a value "SYSTEM" for

HttpContext.Current.User.Identity.Name

which is not the actual current User Name.

I know there are couple options like storing HttpContext.Current in a Session or saving Context's state in some other custom container but given a web farm environment I am assuming that this will not work as expected.

Here is the code I am working on with

function MyFunction(){
PageMethod.MyPageMethod();
}

here is the signature of the server method

[System.Web.Services.WebMethod()]
public static void MyPageMethod()
{
// gives me "SYSTEM"
var user = HttpContext.Current.User.Identity.Name;
}

Also if I use the above code to access user name in OnLoad event of the page then it works fine and returns me the CurrentUserName.

I am trying to get the above code to work in an ASP.NET Webform... :)

So I am wondering if there is a way to access the current actual user in page methods without making use of sessions.

View 1 Replies

SQL Server :: Get All Rows From Query A That Are Not In Query B?

Dec 17, 2010

Using sql server 2005.

I have an Query A of fields that returns X number of records.

I create a Query B of same fields that returns X-80 number of records.

I want to find out the 80 records that are in Query A but are not in Query B. what is the syntax for this?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved