Tuesday, 3 May 2016

How to replace double backslash('\\') using substring function in java script

I am describe ,how to use substring of string and replace the specific characters from strings. In below image, show sql server database table ,  Bloodpressure column contains backslash that is 120\80 .











When fetch record from sql then in c# programming language that contains double back slash 120\\80. In server side that automatically add double backslash "\\".



In below image, I am using String function that is convert Blood Pressure to java script Object that,s contain in index format. In next step ,I am using substring function that first part is 0 means it extract from beginning of string and second part using indexOf function that find the element of index then first part get the value 120 from backslash and in next step using replace function to replace the string upperpart value and "\\" from string with "" then we get next part of backslash.


var str=new String(param.BloodPressure);
var Upperpart=str.substring(0,str.indexOf('\\'));
var Lowerpart=str.replace(Upperpart + "\\","");








Saturday, 30 April 2016

Save date and time from dropdown in sql database table using javascripts

I will describe here to save hh and mm format dropdown value to database. Firstly , I have two dropdown first is Hours and second is Minutes .






When you will fill data then press F12 or inspect element . I will showing it value following as:


Here , you will show $scope._MinuteDataTypeModal contains value 30 and next image show Hours data as:



And I am concatenate both modal using ":" to time format.




In above picture, $scope.VisitTimeModal show actual time format that is "10:30:00".

And in c# or server side code automatically get data in class using get set property . And in below picture show highlighted section that is time is save in database.






Use linq get HH:mm:ss or HH or mm from time data type using c# and use tostring to format datetime

Here , I was describe to get hh:mm or hh and mm format from time or TimeSpan data field using linq in c#. In below show query format to convert time to specific string format.




I will show fetching Hours(hh),Minutes(mm) in debug mode in below as:













Right mouse button click on result and click on quick watch then new windows display here to see highlighted data here as:


























How to get HH:mm:ss from Linq query in c#

Here, I am describing linq query to show HH:mm:ss format from datetime data field in database. In Sql Server Database table that have column name DateOfBirth and it,s type is DataTime.  The question is how can get only hours ,minute and second from date of birth.

Here, First fetch all record from database then write this code to get HH:mm:ss format only:


 var getAll = from r in PersonData 
                   
                   select new 
                  { 
                      BirthTime= r.DateOfBirth.ToString("HH:mm:ss"), 
                      
                   };
 

Sunday, 24 April 2016

How to format pendrive or removable drive forcefully and quickly through command prompt.

1. Open cmd terminal.
                                       



2. Type Command name to format .Syntax is given below as;


Format <Drive letter>: /x /q

For example:  format f: /x /q

3Then press enter key to execute command.
                                            


3.And press enter key when ready. It is take few time to execute command.


                                                                   




4. Then press Enter key for volume label none.



5. Finally , your pendrive format successfully.





Tuesday, 5 April 2016

How to format pendrive through command prompt

How to format pendrive
1. Open Command prompt.
2. Type command name "format <drive letter>:" like that format F:
Add caption

3. then press enter

4. then press enter and show processing list and after 100% it is completed.