Interface Mirror

Proper Solutions to Software Development Problems

  Home  |   Contact  |   Syndication    |   Login
  18 Posts | 8 Stories | 16 Comments | 1 Trackbacks

News



Article Categories

Archives

Post Categories

Link

Sunday, December 19, 2010 #

Quick resolution:

  1. Give full permission to AUTHENTICATED USERS in following folders.
    a) ORACLE_HOME
    b) Program Files\ORACLE
     
  2. Check your PATH. You might have installed different clients in your system and your .NET application is pointing to a home with inappoperiate client. What your .NET application should load is OCI.DLL with File version more than 8.1.7.
According to the MSDN document Oracle and ADO.NET:
 
"The .NET Framework Data Provider for Oracle provides access to an Oracle database using the Oracle Call Interface (OCI) as provided by Oracle Client software. The functionality of the data provider is designed to be similar to that of the .NET Framework data providers for SQL Server, OLE DB, and ODBC. "
 
 
The MSDN document System Requirements (Oracle) says:
"The .NET Framework Data Provider for Oracle requires Microsoft Data Access Components (MDAC) version 2.6 or later. MDAC 2.8 SP1 is recommended. You must also have Oracle 8i Release 3 (8.1.7) Client or later installed. "
 
Both the .NET Framework Data Provider for Oracle and Oracle Data Provider for .NET are data providers to access Oracle database. The former ships with .NET Framework and requires Oracle client version 8.1.7 or above. The latter is provided by Oracle company and requires Oracle client version 9.2 or later.
 
 
The Oracle Data Provider for .NET (ODP.NET) features optimized ADO.NET data access to the Oracle database. ODP.NET allows developers to take advantage of advanced Oracle database functionality, including Real Application Clusters, XML DB, and advanced security.
 
See the document Comparing the Microsoft .NET Framework 1.1 Data Provider for Oracle and the Oracle Data Provider for .NET for more information about the difference.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Sunday, August 17, 2008 #

Hi,

I am working on LINQ since last few days and I think it is a very interesting technology to work on. Before that I used to work on Subsonic to generate code for my Data Access Layer, now by using LINQ not only I have my Data Access Layer but also a lot of more functionalities.
Yesterday I faced a situation where I had to SELECT BETWEEN some values according to my LINQ query. At last I came to the point that LINQ does not have SELECT IN (a1,a2,a3 ...) so I had to do following:
   int [] data = new int [ 5 ] { 0 , 1 , 2 , 3 , 4 };
   var result = from p in context . TableID
                where data . Contains ( p . Id )
                 select p;

Actually I wanted to select those results whose ID is one of 0 , 1 , 2 , 3 , 4 and I had to come reverse rather than something link SQL SELECT * FROM TableId where ID in { 0 , 1 , 2 , 3 , 4 , 5 )

 


 
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Thursday, August 07, 2008 #

Hi,

The ASP.NET Profile stores more information about logged in user and gives the developer capability of playing with those information later on without coding much.

A great use of Profile is when we would like to store more information about the user in our application. Since ASP.NET membership default implementation provides only basic information about the user like Username, password and Email and there is no chance to add more information like User's First name, Last name, Date of birth, Phone etc.

You can implement adding these information by use of Profile. Very easy just add following code to your Web.Config
(here I am adding name and Age to the user information)

Now you can access these information only by
Profile.Name, Profile.Age

<profile >
      <
properties>
        <
add name="Name" allowAnonymous="true" />
        <
add name="Age" allowAnonymous="true" type="System.Int16"/>
      </
properties>
    </
profile>

If you want to save them just set them like,
Profile.Name="interface"
Profile.Age=12

Now, allowAnonymous allows you to access these information when you are anonymous.

Let me clear my words:

Let's consider a scenario that you want to Create a user. You have a form that gets user Name and age and you want to add those information about other information gathered by membership provider to the data store. Since at time creating User you are anonymous to the system Profile.Name and Profile.Age won't be saved. So you must use AllowAnonymous attribute OR use ProfileBase class to set the properties.

System.Web.Profile.ProfileBase pBase = System . Web . Profile . ProfileBase . Create ( userName );
            pBase . SetPropertyValue ( "Name" , name );
            pBase . SetPropertyValue ( "Age" , age );
            pBase . Save ( );
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Monday, August 04, 2008 #

Hi,

By default membership provider in .net has a password policy that restricts you to have passwords of length 7 (at least) and one character among those 7 must be Alph-Numeric. There are various conditions that you want to overlook this policy.

Following are the ways:

Using minimum length and non-alphanumeric character

 <membership ...>
  <providers>
    <add minRequiredPasswordLength=5 minRequiredNonalphanumericCharacters=0 />
  </providers>
 </membership>

Using regular expression

 <membership ...>
  <providers>
    <add passwordStrengthRegularExpression=
                    "^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$" .../>
  </providers>
 </membership>
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Hi,

I just finished a very small module to gather RSS fields from Database and show them in my page. THIS POST FROM MSDN was really helpful and it is just what I wanted.

I tried a lot to use asp:Repeater and XSLT togather to format my feeds but I found no way to do that. At last I came back to XML control in ASP.NET and did following:
  • Made a small parser class to transform my SqlDataReader to XmlDocument object
  • Used Xml Control to combine XmlDocument and XSLT to transform the result.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Hi,

I have found this very useful snippet from asp.net forums

You can format your Datatime object in .Net using following formats.
DateTime.ToString() Patterns 
All the patterns: 0	MM/dd/yyyy	08/22/2006 
1	dddd, dd MMMM yyyy	Tuesday, 22 August 2006 
2	dddd, dd MMMM yyyy	HH:mm Tuesday, 22 August 2006 06:30 
3	dddd, dd MMMM yyyy	hh:mm tt Tuesday, 22 August 2006 06:30 AM 
4	dddd, dd MMMM yyyy	H:mm Tuesday, 22 August 2006 6:30 
5	dddd, dd MMMM yyyy	h:mm tt Tuesday, 22 August 2006 6:30 AM 
6	dddd, dd MMMM yyyy HH:mm:ss	Tuesday, 22 August 2006 06:30:07 
7	MM/dd/yyyy HH:mm	08/22/2006 06:30 
8	MM/dd/yyyy hh:mm tt	08/22/2006 06:30 AM 
9	MM/dd/yyyy H:mm	08/22/2006 6:30 
10	MM/dd/yyyy h:mm tt	08/22/2006 6:30 AM 
10	MM/dd/yyyy h:mm tt	08/22/2006 6:30 AM 
10	MM/dd/yyyy h:mm tt	08/22/2006 6:30 AM 
11	MM/dd/yyyy HH:mm:ss	08/22/2006 06:30:07
12	MMMM dd	August 22 
13	MMMM dd	August 22 
14	yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK	2006-08-22T06:30:07.7199222-04:00 
15	yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK	2006-08-22T06:30:07.7199222-04:00 
16	ddd, dd MMM yyyy HH':'mm':'ss 'GMT'	Tue, 22 Aug 2006 06:30:07 GMT 
17	ddd, dd MMM yyyy HH':'mm':'ss 'GMT'	Tue, 22 Aug 2006 06:30:07 GMT 
18	yyyy'-'MM'-'dd'T'HH':'mm':'ss	2006-08-22T06:30:07 
19	HH:mm	06:30 
20	hh:mm tt	06:30 AM 
21	H:mm	6:30 
22	h:mm tt	6:30 AM 
23	HH:mm:ss	06:30:07 
24	yyyy'-'MM'-'dd HH':'mm':'ss'Z'	2006-08-22 06:30:07Z 
25	dddd, dd MMMM yyyy HH:mm:ss	Tuesday, 22 August 2006 06:30:07 
26	yyyy MMMM	2006 August 
27	yyyy MMMM	2006 August 

The patterns for DateTime.ToString ( 'd' ) : 0 MM/dd/yyyy 08/22/2006

The patterns for DateTime.ToString ( 'D' ) : 0 dddd, dd MMMM yyyy Tuesday, 22 August 2006

The patterns for DateTime.ToString ( 'f' ) : 0 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30
1	dddd, dd MMMM yyyy hh:mm	tt Tuesday, 22 August 2006 06:30 AM 
2	dddd, dd MMMM yyyy H:mm	Tuesday, 22 August 2006 6:30 
3	dddd, dd MMMM yyyy h:mm	tt Tuesday, 22 August 2006 6:30 AM 

The patterns for DateTime.ToString ( 'F' ) : 0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07

The patterns for DateTime.ToString ( 'g' ) : 0 MM/dd/yyyy HH:mm 08/22/2006 06:30
1	MM/dd/yyyy hh:mm	tt 08/22/2006 06:30 AM 
2	MM/dd/yyyy H:mm	08/22/2006 6:30 
3	MM/dd/yyyy h:mm tt	08/22/2006 6:30 AM 

The patterns for DateTime.ToString ( 'G' ) : 0 MM/dd/yyyy HH:mm:ss 08/22/2006 06:30:07

The patterns for DateTime.ToString ( 'm' ) : 0 MMMM dd August 22

The patterns for DateTime.ToString ( 'r' ) : 0 ddd, dd MMM yyyy HH':'mm':'ss 'GMT' Tue, 22 Aug 2006 06:30:07 GMT

The patterns for DateTime.ToString ( 's' ) : 0 yyyy'-'MM'-'dd'T'HH':'mm':'ss 2006-08-22T06:30:07

The patterns for DateTime.ToString ( 'u' ) : 0 yyyy'-'MM'-'dd HH':'mm':'ss'Z' 2006-08-22 06:30:07Z

The patterns for DateTime.ToString ( 'U' ) : 0 dddd, dd MMMM yyyy HH:mm:ss Tuesday, 22 August 2006 06:30:07

The patterns for DateTime.ToString ( 'y' ) : 0 yyyy MMMM 2006 August

  

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Tuesday, July 29, 2008 #

Hi,

I started proper programming with Java in 2001 and since then I was knew that Java is a language that has "Pass by value" for primitives and "Pass by reference" for the non-primitive types. I left programming in Java in 2004 and started using C#. Since last few months again I started part time development in J2ME and last week I came across a very interesting thing. I was sending a byte array as a parameter to a method and expecting to get the same parameter as an initialized array but I don't know why I could not get desired output. Then suddenly it came in my mind to try re-factor the method to a method without parameter and just return the byte array from it. Bingo! I got the result but it took 2 hours of my time to realize the in J2ME don't have anything called "Pass By Reference". Well, I don't know the reason but there must be some design considerations. Today when I was searching the same I came to the point that "Java is Pass-by-Value". I don't know when this has happened but as far as I remember it was pass-by-reference for objects. Well, Let me know if you somewhere I am mistaken.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Sunday, July 20, 2008 #

Hi,

Today I had to find default browser in my client's system and open my page in it. You can find your default Browser Path from

HKEY_CLASSES_ROOT\http\shell\open\command
and Open your page in the value stored against command using
System.Diagnostics.Process.Start()

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Hi,

I was looking a simple way to be able to encrypt and decrypt my Connection Strings. I searched in the net but all i could find was Encrypting and decrypting Connection Strings using aspnet_regiis utility or by creating custom Encryption and decryption classes.
Finally I could a very good way to do encryption and decryption using .NET class library. You can find the video of the tutorial in asp.net , Videos section (Video is called ASP.NET Tips and Tricks) or read it HERE .

I am placing a sample code in following lines of code as well.

 // Encryption
  Configuration config= WebConfigurationManager . OpenWebConfiguration ( Request . ApplicationPath );
        ConfigurationSection configuration = config.GetSection ("connectionStrings");
        if ( configuration != null )
        {
            if ( ! configuration.SectionInformation.IsProtected )
            {
                configuration . SectionInformation . ProtectSection ( "DataProtectionConfigurationProvider" );
                config . Save ( );
            }
        }
   // Decryption
 Configuration config= WebConfigurationManager . OpenWebConfiguration ( Request . ApplicationPath );
        ConfigurationSection configuration = config . GetSection ( "connectionStrings" );
        if ( configuration != null )
        {
            if ( configuration . SectionInformation . IsProtected )
            {
                configuration . SectionInformation . UnprotectSection ( );
                config . Save ( );
            }
        }
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Wednesday, July 16, 2008 #

Hi,

After spending few years in IT I learned that we can find a lot of coders to code in projects but what we cannot find is GOOD CODER. By Good coder I mean someone who has good understanding of the problem in hand and can file a solution for it based on the best possible way. Further who can code based on standards and keep in mind best practices.

I have been using FXCop for a long time and I love using it in my projects. Yesterday I came to see something new (for me) called StyleCop. I liked the way it analyzes my code. It is been used by Microsoft Internal development teams and recently published for Non-MSFT developer. You can find it HERE It can be added to Visual Studio.NET add-ons or used with MS-BUILD. Try to install it and Enjoy using it.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Monday, July 14, 2008 #

Hi,

After a long time, I am back. I have decided to update this blog more frequently. Since I am in hurry the only point to add here for today is

If firewall of your system is on, you cannot access your system's drive even with Administrative rights in Domain. Till you enable file/Printer sharing in your system. after enabling it, port 137 (Port for UNC) will be opened in your system and administrator or anybody with proper rights can easily access your system with \\SYSTEM-NAME\C$ etc.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Saturday, September 01, 2007 #

After a long time again I have decided to send few posts maybe they be useful to some other people. I will try to send such posts more frequently. Please read my Windows Registry Post. I have sent a copy to CodeProject with Windows Registry link. Take a look.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Monday, March 05, 2007 #

I have started writing few Programs about AGI. You can find my first post on Asterisk & C# section of weblog.
For time being i have placed following posts.

Asterisk Programming in C# - Agi

First AGI Program - Hello World

Getting Input From user

Using Streams and Logging

Calculator Sample

DTMF Detector

Useful code snippets

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Monday, October 16, 2006 #

Creating Web services and consuming them is one of the topics that has been one around after emerging things like SOA or Application to Application communication. I have written one article about How to Return User Defined Objects from web services and i am going to continue this article's path next week as well. Take a look at How to Return User Defined Objects from web services.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Tuesday, October 10, 2006 #

Take a look at this link. Really good

3 Layer, 3 Tier and MVC