I'm using Stored-Procedure in SQL-Server2008. The implemented code in C# are as follows:
SqlConnection con = new SqlConnection("...");
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter();
SqlCommand cmd = new SqlCommand("sp_point", con);
da.SelectCommand = cmd;
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
da.Fill(dt);
dataGridView1.DataSource = dt;
The Datetime format in my Database is based on date, hours, minutes, seconds and milliseconds. The columns shows milliseconds too. How should I modify the Code if I want to show the millisecond?
Edit:
My Stored-Procedure :
USE [Diagnose]
GO
/****** Object: StoredProcedure [dbo].[sp_point] Script Date: 02/09/2017 14:04:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[sp_point]
as
SELECT dbo.Station.StationName, dbo.SPointState.SPointStateName, dbo.Point.PointName, dbo.PointState.PointStateName, dbo.PositionPoint.PositionPointName,
dbo.RouteType.RouteTypeName, dbo.PartOfRoute.PartOfRoute AS PartOfRoute, dbo.PointPacket.PointPacketID AS PointPacketID, dbo.PointPacket.Operator AS Operator,
dbo.PointPacket.BlockedPoint AS BlockedPoint, dbo.PointPacket.WarningLable AS WarningLable, dbo.PointPacket.EmergencyLock AS EmergencyLock,
dbo.PointPacket.SendPointStateFromIO AS SendPointStateFromIO, dbo.PointPacket.SendPointPositionFromIO AS SendPointPositionFromIO, dbo.PointPacket.HealthSendFromIO AS HealthSendFromIO,
dbo.Date.Date AS Date_Time
FROM dbo.PointPacket INNER JOIN
dbo.SPointState ON dbo.PointPacket.SPointState = dbo.SPointState.SPointStateID INNER JOIN
dbo.Station ON dbo.PointPacket.StationCode = dbo.Station.StationID INNER JOIN
dbo.Date ON dbo.PointPacket.Date = dbo.Date.DateID INNER JOIN
dbo.Point ON dbo.PointPacket.PointCode = dbo.Point.PointID INNER JOIN
dbo.PointState ON dbo.PointPacket.PointState = dbo.PointState.PointStateID INNER JOIN
dbo.PositionPoint ON dbo.PointPacket.PositionPoint = dbo.PositionPoint.PositionPointID INNER JOIN
dbo.RouteType ON dbo.PointPacket.RouteType = dbo.RouteType.ID INNER JOIN
dbo.PartOfRoute ON dbo.PointPacket.PartOfRoute = dbo.PartOfRoute.ID
select * from PointPacket