User Profile

Collapse

Profile Sidebar

Collapse
dha lak
dha lak
Last Activity: Feb 21 '12, 02:21 PM
Joined: Oct 4 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dha lak
    replied to subtract two datetime values
    I solved using this query.

    SELECT
    convert(varchar (5),convert(dat etime,cast(((DA TEDIFF(minute, StartTime, EndTime) - cast(BreakPerio d as int)) / 60) as char(5)) + ':' + cast(((DATEDIFF (minute, StartTime, EndTime) - cast(BreakPerio d as int)) % 60) as char(5))),108) as TotalCalculated Hours
    from tblEmployee
    See more | Go to post

    Leave a comment:


  • dha lak
    started a topic subtract two datetime values

    subtract two datetime values

    Hi,

    I am searching for a way to find the total no of hours:min between two dates.

    My table design is as below:

    EmployeeId | StartTime | EndTime | BreakPeriod |

    Sample data:
    100 | 2011-09-14 08:00:00.000 | 2011-09-14 15:30:00.000 | 30

    I need to find the total no of hours:mm between these two datetime values. (excluding the breakperiod).

    -----
    ...
    See more | Go to post

  • dha lak
    replied to sort alphanumeric values
    in .NET
    Thanks for the reply!

    I do not have much in-depth knowledge in Linq or generics but i am good in the basics level.

    Is it possible to use generics with Linq to override the default sorting in linq?
    See more | Go to post

    Leave a comment:


  • dha lak
    started a topic sort alphanumeric values
    in .NET

    sort alphanumeric values

    Hi,

    Does anyone know how to sort using linq-entity.


    i use the following code:
    from i in objEntities.Ite ms
    where ....
    orderby i.Name
    select i

    The result is item1,item2,ite m21, item22, item3. But, i want it to be like item1, item2, item3, item21, item22

    Thanks
    See more | Go to post

  • dha lak
    started a topic print datagrid in asp.net

    print datagrid in asp.net

    Hi,

    I am using a hierarchical data in a web form with 4 nested levels.

    I have created a nested GridView. It displays well. But, now i need to print this GridView. I tried this code
    Code:
      <script type="text/javascript" language="javascript">
          function CallPrint(strid) {
              var prtContent = document.getElementById(strid);
              var WinPrint = window.open('',
    ...
    See more | Go to post
    Last edited by Frinavale; Dec 5 '11, 07:24 PM. Reason: Added code tags and fixed the spelling of the word "Please".

  • dha lak
    replied to nested update panel and gridview events
    Thanks a lot

    1) Can you plz suggest me an alternative solution then?


    2) --- I also have a doubt. I have a update panel with just a gridview, with inline editing,deletin g. It is a very simple page. Outside the update panel are just 2 controls: a search textbox and a button. On clicking the button, textbox is not getting cleared. (in the txtBox_Click event handler). so i wrote a jquery function to clear the textbox's...
    See more | Go to post

    Leave a comment:


  • dha lak
    started a topic nested update panel and gridview events

    nested update panel and gridview events

    Hi,



    I use 2 update panels, nested with each other
    1st update panel contains GridView1
    2nd update panel contains GridView2. Gridview2 contains GridView3. But GridView3 just displays data. It has no rowcommand or any events.

    My problem is when a button in GridView2 is clicked. both GridView1 and GridView2's rowcommand event are fired. But, i do not want the GridView1's Rowcommand event to fire....
    See more | Go to post
    Last edited by Frinavale; Nov 17 '11, 02:35 PM. Reason: Added code tags.

  • dha lak
    replied to Pivot table in asp.net gridview control
    Thanks for the reply.

    I will check this link
    See more | Go to post

    Leave a comment:


  • dha lak
    started a topic Pivot table in asp.net gridview control

    Pivot table in asp.net gridview control

    Hi,


    I have 4 tables in my database. i want to create pivot table using them in a gridview.

    1) Category
    CategoryID CategoryName
    1 Milk
    2 Nuts
    3 Fruits
    4 Vegetables
    5 Cakes


    2) SubCategory
    SubCategoryID CategoryID SubCategoryName
    1 1 Soya
    2 2 Almonds
    3 2 Cashew
    4 3 Apple
    5 3 Orange
    6 3 Grapes
    ...
    See more | Go to post

  • I searched for a solution in may forums.
    But seems like it can't be done with a single query.

    The only way is to use a stored procedure or function.

    Thanks for the help
    See more | Go to post

    Leave a comment:


  • Thank you.
    But i want to do the whole transfer in a single query without using stored procedures. This query will be called from csharp console application. Or is it possible to create a temporary stored procedure and delete it once the transfer is complete.
    See more | Go to post

    Leave a comment:


  • How to copy rows from one table to another with same structure

    hi,

    I need to copy tableA and tableB from database1 to database2. Both table has the same structure. Only PlanID 1 and PlanID 2's values should be copied
    tableA is copied, but tableB is a bit confusing.


    DATABASE1
    tableA
    ItemID | PlanID | col3 | col4 | col5 ......
    ------ | -------|------|------|----------
    21 | 1
    22 | 1
    23 | 1
    24 | 1
    25 | 1
    26 | 2
    27...
    See more | Go to post
    Last edited by NeoPa; Oct 4 '11, 12:39 PM. Reason: Added mandatory [CODE] tags for you
No activity results to display
Show More
Working...