Wednesday 23 October 2019

Missing Reporting , SSRS or RDLC option in visual studio community 2017

///////////// Setps

Install SSDT

1.      Open Control Panel > Programs > Programs and Features, and select the entry for your version of Microsoft Visual Studio 2017. In our case, it was Microsoft Visual Studio 2017.
2.      Click the "Change" button on the top bar above the program list.
3.      After the splash screen, a window will open. Press the "Modify" button.
4.      Select Windows and Web Development > Microsoft SQL Server Data Tools, and check the box next to it.
5.      Press the "Update" button on the lower-right hand side of the window.

6.      Once the installation is complete, open your version of Visual Studio. After the new .dll files are loaded, Reporting functionality should be re-implemented, and you should be able to access all related forms, controls, and objects.



             
2.     Microsoft RDLC Report Designer for Visual Studio

To install these extensions:
  1. Launch Visual Studio coummunity 2017
  2. Go to Tools Menu
  3. Select Extensions and Updates
  4. In the Extensions and Updates dialog box, select the Online option
  5. Click in the Search Visual Studio Marketplace dialog box, top right hand corner
  6. Type in Report
  7. Press return
  8. Select Microsoft Rdlc Report Design for Visual Studio
  9. Press the Download button
  10. Select Microsoft Reporting Services Project
  11. Press the Download button
  12. Press the Close button
Installation begin when the visual studio is closed

/////////////  Other Steps are given below
















MVC Client side validation using jquery



///////////////////Add Namespace-

      using System.Collections.Generic;

      using System.ComponentModel.DataAnnotations;

//////////////////// Add models with required

   public class Login
    {
        [Required]
        public string UserID { get; set; }
        [Required]
        public string Password { get; set; }

    }


//////////////////// web.config file configuration


<appSettings>
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>


////////////////////  Add J-query Libraries Inside script folder

    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script src="~/Scripts/jquery.validate.min.js"></script>
    <script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>

    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script


////////////////////  Call J-query Libraries on page .cshtml

    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script src="~/Scripts/jquery.validate.js"></script>

    <script src="~/Scripts/jquery.validate.unobtrusive.js"></script


////////////////////  Call J-query Libraries page on top of the page

@{
    Layout = null;
    Html.EnableClientValidation(true);
}







Wednesday 16 October 2019

DateTime In String Format Using [C#]

//////////////

DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);

String.Format("{0:y yy yyy yyyy}", dt);  // "8 08 008 2008"   year
String.Format("{0:M MM MMM MMMM}", dt);  // "3 03 Mar March"  month
String.Format("{0:d dd ddd dddd}", dt);  // "9 09 Sun Sunday" day
String.Format("{0:h hh H HH}", dt);  // "4 04 16 16"      hour 12/24
String.Format("{0:m mm}", dt);  // "5 05"minute
String.Format("{0:s ss}", dt);  // "7 07"second
String.Format("{0:f ff fff ffff}", dt);  // "1 12 123 1230"   sec.fraction
String.Format("{0:F FF FFF FFFF}", dt);  // "1 12 123 123"    without zeroes
String.Format("{0:t tt}", dt);  // "P PM"A.M. or P.M.
String.Format("{0:z zz zzz}", dt);  // "-6 -06 -06:00"   time zone

// date separator in german culture is "." (so "/" changes to ".")
String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9/3/2008 16:05:07" - english (en-US)
String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9.3.2008 16:05:07" - german (de-DE)


// month/day numbers without/with leading zeroes
String.Format("{0:M/d/yyyy}", dt);// "3/9/2008"
String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"

// day/month names
String.Format("{0:ddd, MMM d, yyyy}", dt);    // "Sun, Mar 9, 2008"
String.Format("{0:dddd, MMMM d, yyyy}", dt);  // "Sunday, March 9, 2008"

// two/four digit year
String.Format("{0:MM/dd/yy}", dt);// "03/09/08"

String.Format("{0:MM/dd/yyyy}", dt);          // "03/09/2008"





SortName
DateTimeFormatInfo property
Pattern value (for en-US culture)
t
ShortTimePattern
h:mm tt
d
ShortDatePattern
M/d/yyyy
T
LongTimePattern
h:mm:ss tt
D
LongDatePattern
dddd, MMMM dd, yyyy
f
(combination of D and t)
dddd, MMMM dd, yyyy h:mm tt
F
FullDateTimePattern
dddd, MMMM dd, yyyy h:mm:ss tt
g
(combination of d and t)
M/d/yyyy h:mm tt
G
(combination of d and T)
M/d/yyyy h:mm:ss tt
mM
MonthDayPattern
MMMM dd
yY
YearMonthPattern
MMMM, yyyy
rR
RFC1123Pattern
ddd, dd MMM yyyy HH':'mm':'ss 'GMT' (*)
s
SortableDateTi­mePattern
yyyy'-'MM'-'dd'T'HH':'mm':'ss (*)
u
UniversalSorta­bleDateTimePat­tern
yyyy'-'MM'-'dd HH':'mm':'ss'Z' (*)


(*) = culture independent



//Standard format specifiers in String.Format

String.Format("{0:t}", dt);  // "4:05 PM" ShortTime
String.Format("{0:d}", dt);  // "3/9/2008"ShortDate
String.Format("{0:T}", dt);  // "4:05:07 PM"          LongTime
String.Format("{0:D}", dt);  // "Sunday, March 09, 2008"          LongDate
String.Format("{0:f}", dt);  // "Sunday, March 09, 2008 4:05 PM"  LongDate+ShortTime
String.Format("{0:F}", dt);  // "Sunday, March 09, 2008 4:05:07 PM" FullDateTime
String.Format("{0:g}", dt);  // "3/9/2008 4:05 PM"    ShortDate+ShortTime
String.Format("{0:G}", dt);  // "3/9/2008 4:05:07 PM" ShortDate+LongTime
String.Format("{0:m}", dt);  // "March 09"MonthDay
String.Format("{0:y}", dt);  // "March, 2008"         YearMonth
String.Format("{0:r}", dt);  // "Sun, 09 Mar 2008 16:05:07 GMT"   RFC1123
String.Format("{0:s}", dt);  // "2008-03-09T16:05:07" SortableDateTime
String.Format("{0:u}", dt);  // "2008-03-09 16:05:07Z"UniversalSortableDateTime

Wednesday 9 October 2019

ajax calendar control Error Sys.ArgumentOutOfRangeException: Sys.ArgumentOutOfRangeException: Value must be an integer. Parameter name: y or Parameter name: x

/////////////////////

change Toolkit Script Manager from

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"

            </asp:ToolkitScriptManager>


change Toolkit Script Manager To


<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" LoadScriptsBeforeUI="false" ScriptMode="Release"
                EnablePartialRendering="true">
            </asp:ToolkitScriptManager>


SQL statement to get column table type using sql server

/////////


SELECT c.name as ColumnName, case When t.name ='varchar' OR t.name ='nvarchar' or t.name ='Text' Then 'System.String'
When t.name ='int' Then 'System.Int32'
When t.name ='decimal' Then 'System.Decimal'
When t.name ='float' Then 'System.Decimal'
When t.name ='datetime' OR t.name ='Date' OR t.name ='time' Then 'System.DateTime'
When t.name ='date' Then 'System.Date'
When t.name ='bit' Then 'System.Boolean'
--When t.name ='Text' Then 'System.Text'
else 'System.' + t.name end AS TypeName  FROM sys.columns c INNER JOIN sys.types t ON c.user_type_id = t.user_type_id LEFT OUTER JOIN sys.index_columns ic ON ic.object_id = c.object_id AND ic.column_id = c.column_id LEFT OUTER JOIN sys.indexes i ON ic.object_id = i.object_id AND ic.index_id = i.index_id WHERE c.object_id = ( SELECT type_table_object_id FROM sys.table_types WHERE name =  'TableName')



/////////////// Result

ColumnName
TypeName
EmployeeID
System.Int32
ContactPerson
System.String
Contact
System.String
Relationship
System.Int32
Address
System.String
Other
System.String

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...