SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz Development Resources
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.

Tuba



  • "Error while trying to run project" "Unable to start debugging" "No such interface supported"

    Yesterday, Office 2007 had caused an error itself and decided to repair itself, then some installation screens popped up.. a total mess that led my Visual Studio 2003 environment to stop debugging.
    After a search on the internet I found that, this inproper setup attempt could affect the following files:

    Program Files\Common Files\Microsoft Shared\VS7Debug\coloader.dll
    Program Files\Common Files\Microsoft Shared\VS7Debug\csm.dll
    Program Files\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll
    Program Files\Common Files\Microsoft Shared\VS7Debug\pdm.dll
    Program Files\Common Files\Microsoft Shared\VS7Debug\vs7jit.exe
    Program Files\Common Files\Microsoft Shared\VS7Debug\mdm.exe

    I replaced the files from a proper machine and registered them again by typing the following lines to the command window.

    regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\coloader.dll"

    regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\csm.dll"

    regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\msdbg2.dll"

    regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7DEBUG\pdm.dll "


    "c:\Program Files\Common Files\Microsoft Shared\VS7Debug\vs7jit" /regserver

    "c:\Program Files\Common Files\Microsoft Shared\VS7Debug\mdm.exe" /regserver

    Details of the error:
    -The debugger was not working properly but the exe file could run without debugging

     

    Enjoy Coding!


     

  • "dte.olb could not be loaded" "Please re-run setup and repair your installation"

    while opening a project, I had this error in my Visual Studio 2003 but clearly it can happen in other versions as well.

    Here is the registry command:

    regsvr32.exe "c:\Program Files\Common Files\Microsoft Shared\MSEnv\dte.olb"

     

    Enjoy coding!

  • "System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security" and "EnterpriseLibrary The Zone of the assembly that failed was: Mycomputer"

    These errors both occured in my new project that uses enterprise library logging.

    First of all thanks to:http://community.codesmithtools.com/forums/t/2126.aspx

    PROBLEM Windows XP: "System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security."

    SOLUTION: Add the .NET user, "ASPNET", to the "ADMINISTRATORS" group.

    My second thanks goes to: http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/07/27/WCF-Test-Client-svcutil.aspx

    Disable strong name signing for svcutil.exe by opening a Visual Studio Command Prompt. At the command prompt run: sn -Vr "<program files>\Microsoft SDKs\Windows\v6.0A\Bin\SvcUtil.exe"  (replace <program files> with your program files path - ex: c:\Program Files)

    God knows, we would have to be better developers if google was not invented :P

     

  • "error creating control" "is not a valid IIS application"

    In my web application on aspx pages, the controls were not loaded, they had boxes on them with the error message.

    Then I right clicked on my web project from the Visual Studio 2005. Selected  the "Web" tab and put a tick on the radio button "Use IIS Web Server". then I clicked the button "Create Virtual Directory"

    After I build the project, everything looked OK.

    PS:Thanks a lot to Hosam Kamel, this problem had a solution really fast:

    http://weblogs.asp.net/hosamkamel/archive/2007/09/15/resolving-error-creating-control-xxx-in-web-application-project.aspx

    use IIS web server for Visual Studio project

  • A potentially dangerous Request.Form value was detected from the client


    I am back, with probably the simplest problem with the simplest solution on earth.

    Here, add this to the Page tag in your aspx page.

    validateRequest="false"

    By the way the problem occurs in .aspx pages using ASP.NET 1.1 and ASP.NET 2.0. and when you insert some characters into text fields on the page that could be interpreted as special HTML characters and confuse the parser.

    Any alternative asked Eralper, well.. I need to dig deeper and come back later

  • Creating Windows XP Icons

    Have you ever wondered how Microsoft is creating its icons?

    Here is the explanation and same samples:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/winxpicons.asp

  • Public Sub '<subname>' is obsolete

    Means you should change the functions and subs according to the recommendations  of the environment. You still can continue to use the existing, but after 3 years (I guess) it will not be supported. you better take a look at the following changes which do look OK but still needs testing.

    System.Configuration.ConfigurationSettings.AppSettings ->

    System.Configuration.ConfigurationManager.GetSection

    Page.RegisterArrayDeclaration ->

    Page.ClientScript.RegisterArrayDeclaration

    Page.RegisterOnSubmitStatement ( xxxx... ->

    Page.ClientScript.RegisterOnSubmitStatement(page.Gettype, xxx...

  • Return type of function '<procedurename>' is not CLS-compliant

    God, Visual Studio 2005 conversion gave me brand new 350 warnings!!

    Most of them were related to the CLS issue which has the idea to make all the variable declarations standart (camel case as far as I know)

    To put an end to this pain, just open your assemblyinfo file and set the following line to false:

    <Assembly: CLSCompliant(False)>

    Then you will free your soul

    Enjoy coding

  • Culture List for Resource File Names (Big one)

    My upcoming project will be used in 35 countries and in XXX languages. So here is the list that will reside in my database to select the resource file to use according to the country + language selection of the users.

    Culture Name

    Culture Identifier

    Language-Country/Region

    ""

    0x007F

    invariant culture

    af

    0x0036

    Afrikaans

    af-ZA

    0x0436

    Afrikaans - South Africa

    sq

    0x001C

    Albanian

    sq-AL

    0x041C

    Albanian - Albania

    ar

    0x0001

    Arabic

    ar-DZ

    0x1401

    Arabic - Algeria

    ar-BH

    0x3C01

    Arabic - Bahrain

    ar-EG

    0x0C01

    Arabic - Egypt

    ar-IQ

    0x0801

    Arabic - Iraq

    ar-JO

    0x2C01

    Arabic - Jordan

    ar-KW

    0x3401

    Arabic - Kuwait

    ar-LB

    0x3001

    Arabic - Lebanon

    ar-LY

    0x1001

    Arabic - Libya

    ar-MA

    0x1801

    Arabic - Morocco

    ar-OM

    0x2001

    Arabic - Oman

    ar-QA

    0x4001

    Arabic - Qatar

    ar-SA

    0x0401

    Arabic - Saudi Arabia

    ar-SY

    0x2801

    Arabic - Syria

    ar-TN

    0x1C01

    Arabic - Tunisia

    ar-AE

    0x3801

    Arabic - United Arab Emirates

    ar-YE

    0x2401

    Arabic - Yemen

    hy

    0x002B

    Armenian

    hy-AM

    0x042B

    Armenian - Armenia

    az

    0x002C

    Azeri

    az-Cyrl-AZ

    0x082C

    Azeri (Cyrillic) - Azerbaijan

    az-Latn-AZ

    0x042C

    Azeri (Latin) - Azerbaijan

    eu

    0x002D

    Basque

    eu-ES

    0x042D

    Basque - Basque

    be

    0x0023

    Belarusian

    be-BY

    0x0423

    Belarusian - Belarus

    bg

    0x0002

    Bulgarian

    bg-BG

    0x0402

    Bulgarian - Bulgaria

    ca

    0x0003

    Catalan

    ca-ES

    0x0403

    Catalan - Catalan

    zh-HK

    0x0C04

    Chinese - Hong Kong SAR

    zh-MO

    0x1404

    Chinese - Macao SAR

    zh-CN

    0x0804

    Chinese - China

    zh-Hans

    0x0004

    Chinese (Simplified)

    zh-SG

    0x1004

    Chinese - Singapore

    zh-TW

    0x0404

    Chinese - Taiwan

    zh-Hant

    0x7C04

    Chinese (Traditional)

    hr

    0x001A

    Croatian

    hr-HR

    0x041A

    Croatian - Croatia

    cs

    0x0005

    Czech

    cs-CZ

    0x0405

    Czech - Czech Republic

    da

    0x0006

    Danish

    da-DK

    0x0406

    Danish - Denmark

    div

    0x0065

    Dhivehi

    div-MV

    0x0465

    Dhivehi - Maldives

    nl

    0x0013

    Dutch

    nl-BE

    0x0813

    Dutch - Belgium

    nl-NL

    0x0413

    Dutch - The Netherlands

    en

    0x0009

    English

    en-AU

    0x0C09

    English - Australia

    en-BZ

    0x2809

    English - Belize

    en-CA

    0x1009

    English - Canada

    en-029

    0x2409

    English - Caribbean

    en-IE

    0x1809

    English - Ireland

    en-JM

    0x2009

    English - Jamaica

    en-NZ

    0x1409

    English - New Zealand

    en-PH

    0x3409

    English - Philippines

    en-ZA

    0x1C09

    English - South Africa

    en-TT

    0x2C09

    English - Trinidad and Tobago

    en-GB

    0x0809

    English - United Kingdom

    en-US

    0x0409

    English - United States

    en-ZW

    0x3009

    English - Zimbabwe

    et

    0x0025

    Estonian

    et-EE

    0x0425

    Estonian - Estonia

    fo

    0x0038

    Faroese

    fo-FO

    0x0438

    Faroese - Faroe Islands

    fa

    0x0029

    Farsi

    fa-IR

    0x0429

    Farsi - Iran

    fi

    0x000B

    Finnish

    fi-FI

    0x040B

    Finnish - Finland

    fr

    0x000C

    French

    fr-BE

    0x080C

    French - Belgium

    fr-CA

    0x0C0C

    French - Canada

    fr-FR

    0x040C

    French - France

    fr-LU

    0x140C

    French - Luxembourg

    fr-MC

    0x180C

    French - Monaco

    fr-CH

    0x100C

    French - Switzerland

    gl

    0x0056

    Galician

    gl-ES

    0x0456

    Galician - Galician

    ka

    0x0037

    Georgian

    ka-GE

    0x0437

    Georgian - Georgia

    de

    0x0007

    German

    de-AT

    0x0C07

    German - Austria

    de-DE

    0x0407

    German - Germany

    de-LI

    0x1407

    German - Liechtenstein

    de-LU

    0x1007

    German - Luxembourg

    de-CH

    0x0807

    German - Switzerland

    el

    0x0008

    Greek

    el-GR

    0x0408

    Greek - Greece

    gu

    0x0047

    Gujarati

    gu-IN

    0x0447

    Gujarati - India

    he

    0x000D

    Hebrew

    he-IL

    0x040D

    Hebrew - Israel

    hi

    0x0039

    Hindi

    hi-IN

    0x0439

    Hindi - India

    hu

    0x000E

    Hungarian

    hu-HU

    0x040E

    Hungarian - Hungary

    is

    0x000F

    Icelandic

    is-IS

    0x040F

    Icelandic - Iceland

    id

    0x0021

    Indonesian

    id-ID

    0x0421

    Indonesian - Indonesia

    it

    0x0010

    Italian

    it-IT

    0x0410

    Italian - Italy

    it-CH

    0x0810

    Italian - Switzerland

    ja

    0x0011

    Japanese

    ja-JP

    0x0411

    Japanese - Japan

    kn

    0x004B

    Kannada

    kn-IN

    0x044B

    Kannada - India

    kk

    0x003F

    Kazakh

    kk-KZ

    0x043F

    Kazakh - Kazakhstan

    kok

    0x0057

    Konkani

    kok-IN

    0x0457

    Konkani - India

    ko

    0x0012

    Korean

    ko-KR

    0x0412

    Korean - Korea

    ky

    0x0040

    Kyrgyz

    ky-KG

    0x0440

    Kyrgyz - Kyrgyzstan

    lv

    0x0026

    Latvian

    lv-LV

    0x0426

    Latvian - Latvia

    lt

    0x0027

    Lithuanian

    lt-LT

    0x0427

    Lithuanian - Lithuania

    mk

    0x002F

    Macedonian

    mk-MK

    0x042F

    Macedonian - Former Yugoslav Republic of Macedonia

    ms

    0x003E

    Malay

    ms-BN

    0x083E

    Malay - Brunei

    ms-MY

    0x043E

    Malay - Malaysia

    mr

    0x004E

    Marathi

    mr-IN

    0x044E

    Marathi - India

    mn

    0x0050

    Mongolian

    mn-MN

    0x0450

    Mongolian - Mongolia

    no

    0x0014

    Norwegian

    nb-NO

    0x0414

    Norwegian (Bokmål) - Norway

    nn-NO

    0x0814

    Norwegian (Nynorsk) - Norway

    pl

    0x0015

    Polish

    pl-PL

    0x0415

    Polish - Poland

    pt

    0x0016

    Portuguese

    pt-BR

    0x0416

    Portuguese - Brazil

    pt-PT

    0x0816

    Portuguese - Portugal

    pa

    0x0046

    Punjabi

    pa-IN

    0x0446

    Punjabi - India

    ro

    0x0018

    Romanian

    ro-RO

    0x0418

    Romanian - Romania

    ru

    0x0019

    Russian

    ru-RU

    0x0419

    Russian - Russia

    sa

    0x004F

    Sanskrit

    sa-IN

    0x044F

    Sanskrit - India

    sr-Cyrl-SP

    0x0C1A

    Serbian (Cyrillic) - Serbia

    sr-Latn-SP

    0x081A

    Serbian (Latin) - Serbia

    sk

    0x001B

    Slovak

    sk-SK

    0x041B

    Slovak - Slovakia

    sl

    0x0024

    Slovenian

    sl-SI

    0x0424

    Slovenian - Slovenia

    es

    0x000A

    Spanish

    es-AR

    0x2C0A

    Spanish - Argentina

    es-BO

    0x400A

    Spanish - Bolivia

    es-CL

    0x340A

    Spanish - Chile

    es-CO

    0x240A

    Spanish - Colombia

    es-CR

    0x140A

    Spanish - Costa Rica

    es-DO

    0x1C0A

    Spanish - Dominican Republic

    es-EC

    0x300A

    Spanish - Ecuador

    es-SV

    0x440A

    Spanish - El Salvador

    es-GT

    0x100A

    Spanish - Guatemala

    es-HN

    0x480A

    Spanish - Honduras

    es-MX

    0x080A

    Spanish - Mexico

    es-NI

    0x4C0A

    Spanish - Nicaragua

    es-PA

    0x180A

    Spanish - Panama

    es-PY

    0x3C0A

    Spanish - Paraguay

    es-PE

    0x280A

    Spanish - Peru

    es-PR

    0x500A

    Spanish - Puerto Rico

    es-ES

    0x0C0A

    Spanish - Spain

    es-UY

    0x380A

    Spanish - Uruguay

    es-VE

    0x200A

    Spanish - Venezuela

    sw

    0x0041

    Swahili

    sw-KE

    0x0441

    Swahili - Kenya

    sv

    0x001D

    Swedish

    sv-FI

    0x081D

    Swedish - Finland

    sv-SE

    0x041D

    Swedish - Sweden

    syr

    0x005A

    Syriac

    syr-SY

    0x045A

    Syriac - Syria

    ta

    0x0049

    Tamil

    ta-IN

    0x0449

    Tamil - India

    tt

    0x0044

    Tatar

    tt-RU

    0x0444

    Tatar - Russia

    te

    0x004A

    Telugu

    te-IN

    0x044A

    Telugu - India

    th

    0x001E

    Thai

    th-TH

    0x041E

    Thai - Thailand

    tr

    0x001F

    Turkish

    tr-TR

    0x041F

    Turkish - Turkey

    uk

    0x0022

    Ukrainian

    uk-UA

    0x0422

    Ukrainian - Ukraine

    ur

    0x0020

    Urdu

    ur-PK

    0x0420

    Urdu - Pakistan

    uz

    0x0043

    Uzbek

    uz-Cyrl-UZ

    0x0843

    Uzbek (Cyrillic) - Uzbekistan

    uz-Latn-UZ

    0x0443

    Uzbek (Latin) - Uzbekistan

    vi

    0x002A

    Vietnamese

    vi-VN

    0x042A

    Vietnamese - Vietnam

     

    Thanks to: http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx

     

  • Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly...

    Visual Studio 2005 design time kept giving me the specified error because of the resource files I have been using. (and not using)

    The setting of the default culture was being done by the application config. But since in design time you can not read values from your web.config, error occured.

    To prevent this, I added a neutral resource to the resources folder with no culturename like : Userinterface.resx (all the others had names like Userinterface.en-CA.resx)

    Also you can set a static default culture in your code as well.

    Then everything started working. Give it a try befıre panicing about how different Visual Studio 2005 works.

    Enjoy coding

  • Visual Studio 2005 - Unable to attach the debugger

    I know it is a bit tooo late to admit that I am still using Visual Studio .NET 2003 heavily on my projects. So yesterday I happened to open my first 2005 solution which is converted from 2003. Later on I decided to continue my work using my previous environment which is 2003. But nothing was working normal. I was unable to update web references, I could not debug my project and attach aspnet worker process to my debugger. And all the messages I get had no info in them like:

    "Unable to attach the debugger" or "Unable to update the web reference.."

    Obviously it had something to do with the framework version difference of the two environments.

    I checked IIS and from the properties of my web site, under the ASP.NET tab, there it was! ASP.NET version was changed to 2.0 and although I was using 2003 environment, the settings on the IIS did not change. So 2003 had problems working with 2.0

    That is what my hassle was all about

    Enjoy coding

     

     

  • HTML Codes

    I have not done a deep search on Gooogle to find a list of all the codes with special characters in HTML, but I have found a few, not with much records.

    The character I was looking for was an arrow pointing up.

    What I did was (with Eralper's help :)) select the character from Microsoft Word, save the word document as html and view its source. Here it is: &#8593;

    You might still need those kind of lists to check the HTML standard.

    Enjoy coding.

  • The process cannot access the file because it is being used by another process.

    Your very nice working project can give the error in the heading occasionaly to drive you mad during build.

    But with this small trick you can beat your environment and make it work in the way it used to work.

    Select Relase mode and Rebuilt the solution, later choose Debug again and Rebuild.

    Now you can go back to work happiliy with your project as usual (!?)

  • working with App.config file

    There are different ways to access the key values in your app.config file.

    The easiest is using the appsetting section.

    Here is what this section looks like in your app.config file:

    <appSettings>

    <add key="BestWebSiteOnEarth.Joke" value=http://www.kodyaz.com/>

    </appSettings>

    By using the System.Configuration.ConfigurationSettings namespace in your forms, you can simply acces the key value by typing :

    AppSettings.Item("BestWebSiteOnEarth.Joke")

    There can be another section in your app.config file to seperate key blocks.

    <configSections>

    <section name="ApplicationConfiguration" type="SystemFramework.ApplicationConfiguration, SystemFramework"/>

    <section name="ExceptionManagement" type="SystemFramework.ExceptionManagement.ExceptionManagerSectionHandler,SystemFramework"/>

    </configSections>

    The code in you forms to access those values are different. You also should have the specified classes in your project as well (ApplicationConfiguration and ExceptionManagerSectionHandler)

    Those classes can be automatically prepared by using some tools and you can also manually create them. As a simple example, if you have the following key in your app.config file:

    <ApplicationConfiguration>

    <add key="SystemFramework.Application.EnvironmentMode" value="1"/>

    <add key="SystemFramework.Application.CountyId" value="1"/>

    </ApplicationConfiguration>

    you should add the following code to your ApplicationConfiguration  file:

    Private Shared fieldCountryIdApplication As String

    Public Shared ReadOnly Property ApplicationCountyId() As String

    Get

    ApplicationCountyId = fieldCountryIdApplication

    End Get

    End Property

    '------------------

    Public Overloads Shared Function ReadSetting(ByVal settings As NameValueCollection, ByVal key As String, ByVal defaultValue As String) As String

    Try

    Dim setting As Object = settings(key)

    If setting Is Nothing Then

    ReadSetting = defaultValue

    Else

    ReadSetting = CStr(setting)

    End If

    Catch

    ReadSetting = defaultValue

    End Try

    End Function

    '-----------------------------

    Function Create(ByVal parent As Object, ByVal configContext As Object, ByVal section As System.Xml.XmlNode) As Object Implements IConfigurationSectionHandler.Create

    Dim settings As NameValueCollection

    Try

    Dim baseHandler As NameValueSectionHandler

    baseHandler = New NameValueSectionHandler

    settings = CType(baseHandler.Create(parent, configContext, section), NameValueCollection)

    Catch

    End Try

    fieldCountryIdApplication = ReadSetting(settings, COUNTRYID_APPLICATION, COUNTRYID_APPLICATION_DEFAULT)

    End Function

    Etc, etc, I think you get the idea.

    So in your other forms from where you want to access the key values you can use the following lines:

    Dim config As ApplicationConfiguration

    config = CType(System.Configuration.ConfigurationSettings.GetConfig("ApplicationConfiguration"), ApplicationConfiguration)

    config.ApplicationCountyId.ToString() is the value you have been trying to reach for the last 5 minutes.

    Enjoy coding

  • Handling Unhandled Exceptions in Windows Forms

    I myself don't enjoy reading long articles, complex explanations and less code. For those who do enjoy, you can have a look at the msdn version here : http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx

    For the rest, here you can find what works for me:

    I added the following code segment to my base form in  Public Sub New()

    'The 2 event handlers

    'add an unhandled exceptions handler

    Dim currentDomain As AppDomain = AppDomain.CurrentDomain

    'for regular unhandled stuff

    AddHandler currentDomain.UnhandledException, AddressOf MYExceptionHandler

    'for threads behind forms

    AddHandler Application.ThreadException, AddressOf MYThreadHandler

    I added the MYThreadHandler and MYExceptionHandler functions to the same form as well.

    Private Sub MYExceptionHandler(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)

    Dim EX As Exception

    EX = CType(e.ExceptionObject, Exception)

    MessageBox.Show(EX.StackTrace)

    End Sub

    Private Sub MYThreadHandler(ByVal sender As Object, ByVal e As Threading.ThreadExceptionEventArgs)

    MessageBox.Show(e.Exception.StackTrace)

    End Sub

    For all the other forms inherited from my base class, any exception in the code without a try and catch block go directly to my handling section.

    You also should pay attention to configure your applications Exception Settings under the Debug menu to Continue when the exception is not handled. So that the big window asking you to Break or Continue when an exception occurs will not appear and the code will keep on without being interrupted.

    In our project we send mail messages to the related developers after catching exceptions. The mail process is using publisher. I will post the code soon. Enjoy coding..

More Posts Next page »




This Blog
Syndication
Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems