0
Posted on 5:53 AM by Softminer and filed under ,

if you put this in .aspx code it will return back 0.0.0.0

  1.  <%= System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()%>

you have to fill in either in controller or in Helper class:

here is how to fill it in helper class:

http://www.craftyfella.com/2010/01/adding-assemblyversion-to-aspnet-mvc.html
0
Posted on 6:15 AM by Softminer and filed under

This is the list of Dateformat in SQL 2008 with examples

Data typeOutput
Time12:35:29. 1234567
Date2007-05-08
Smalldatetime2007-05-08 12:35:00
Datetime2007-05-08 12:35:29.123
datetime22007-05-08 12:35:29. 1234567
Datetimeoffset2007-05-08 12:35:29.1234567 +12:15


as you see the new Datetimeoffset is useful for timezone in different countries.

Timestap is changed to rowversion (both are valid)

timestap Is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows.

if you read a row and wants to edit it check the timestamp in update, if the timestamp is changed means during the update this row is changed by someone else.

furthermore, if you want to have a datetime column which automatically fills in insert and update by sql you should make a default value to GETDATE() function.

this default value will fullfill the insert and for update you need to add a trigger like this

CREATE TRIGGER KeepUpdated on Profiles
FOR UPDATE, INSERT AS
UPDATE dbo.Profiles
SET LastUpdate = GetDate()
WHERE Username IN (SELECT Username FROM inserted)
0
Posted on 5:42 AM by Softminer and filed under

after creating webapplication you should enable the http,net.tcp port.


windows communication foundation service should be enables in Windows component
WAS ( windows activation service) : when we add this then .svc will add to the handlers


then call this on IE
And then we have to call with
http://localhost/services/myservice.svc

when you call this the the MEX file will be created and then the net.tcp will work
then you can call service by WCF test client

WCF test client is in this address:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

run it and add this service to it
net.tco://localhost/services/myservice.svc

PS: if it doesnt work please check if net.tcp protocol is in sitebinding
right click on (default website and click on edit banding)
if net.tcp is not in the list add it as follow:
0
Posted on 2:04 AM by Softminer and filed under ,

usually its better to install vault (source gear) after SSMS otherewise installing vault will cause an error in running SSMS.

The server returned the following error:Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.OLE.Interop.IServiceProvider'. This operation failed
because the QueryInterface call on the COM component for the interface with IID
'{6D5140C1-7436-11CE-8034-00AA006009FA}' failed due to the following error: No such
interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


to fix this error you need to register this dll's again

Urlmon.dll
Mshtml.dll
Actxprxy.dll
Oleaut32.dll
Shell32.dll
Shdocvw.dll

For example, click on Start, and then choose Run, and in the Run dialog type:
dont forget to run cmd as administratore:

regsvr32 Urlmon.dll

try it first in %WinDir%\SysWOW64 and if it doesnt work try %windir%\system32 folder.

after this maybe you have this sideeffect that cause you explorer to open the folders alway in new page.

to solve this :

regsvr32 "%programfiles%\Internet Explorer\ieproxy.dll"
regsvr32 "C:\Program Files (x86)\Internet Explorer\ieproxy.dll"

to solve the SSMS and vault in Windows x32 do following step:

copy this text in .reg file and run it

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Interface\{6D5140C1-7436-11CE-8034-00AA006009FA}\ProxyStubClsid32]
@="{A4A1A128-768F-41E0-BF75-E4FDDD701CBA}"
0
Posted on 2:34 AM by Softminer and filed under

in c# by default when the UI culture is changed then for every UI language there is a format

for example for

en-US is MM/dd/yyyy
de-DE is dd.MM.yyyy

so if you UIculture is changed to de-DE then the datatime format will also change to dd.MM.yyyy

if you want to change datetime format for de-DE to MM/dd/yyyy then try to set it

culture.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy";
2
Posted on 3:46 AM by Softminer and filed under

Microsoft Windows SDK, Platform SDK, and .NET Framework SDK are software development kits from Microsoft that contain header files, libraries, samples, documentation and tools required to develop applications for Microsoft Windows and .NET Framework.

It is usually installed on C:\Program Files\Microsoft SDKs\Windows

these are the versions of SDK


Windows Server 2003 SP1 Platform SDK 5.2.3790.1830.15
Windows Server 2003 R2 PSDK 5.2.3790.2075.51

Windows Vista Update & .NET 3.0 SDK v6.0
Included in Visual Studio 2008[5] v6.0a
Windows Server 2008 & .NET 3.5 SDK v6.1
Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP 1 v7.0
Microsoft Windows SDK for Windows 7 and .NET Framework 4 v7.1

for example if you use WCFclient in Visualstudio 2008 then it will call svcutil.exe from SDK 6 but if you call it in VS 2010 then it will call svcutil.exe in SDK 7.

if in the command prompt of Visual studio type "where svcutil.exe" then you can see which SDK is called.

the default SDK in in registery in this path :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows

if you install VS 2010 then SDK 7 will automatically will install on your machine.

you can install SDK 7 from here

lease note if you are running a 64-bit version of Windows and Visual Studio 2008, please upgrade to Visual Studio 2008 SP1 before installing the Windows 7 SDK.
1
Posted on 5:20 AM by Softminer and filed under

usually extension method are used to add new function to a class. for example you want to add extension method to "String" class in view like Left.


public static string Left(this String param, int length)

{

   string result = param.Substring(param.Length – length, length);

   return result;

 }

then you can use it in view as
<% Model.city.Left(10) %>