SQL Server ~ Creating a CLR User Defined Function Error 181

Cannot use the OUTPUT option in DECLARE or CREATE FUNCTION statement

So this may or may not trip you up. If you are like me, you want thing to run fast. One of those ways is to pass a reference to a variable as opposed to passing a copy of the value to the function. In .Net this works well, however SQL Server translates the byref to it’s equivalent which is OUTPUT option. Simply bite the bullet and change the function to have all of your parameters to byval and you are good to go.

Hopefully I saved you some time and agrivation.

Advertisements

VB.Net C# Designtime Error ~ ‘.ctor’ is not a valid identifier.

Tired of searching you project for that string? The answer is simple, which was proposed by Vladmir from Serbia on MSDN. The name of your class or form shares it’s name with a function or subroutine contained within that class. Like below:

public class Form1

private sub Form1()

end sub

end class

Changing the name of the method will fix this issue.

OracleConnection ~ Connection String Nightmare

I spent quite a bit of time today debugging an oracleconnection object. It would fail everytime the connection string property was set. This is what I would recieve in the error log:

Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e2111c0

Exception code: 0xe0434f4d

Fault offset: 0x0000d36f

I didn’t get to far Duck Duck Go’ing (or Googling) on this so I threw the assignment into an try catch block. I got an error  “Connection string is not well formed”. Connectionstrings.com had a great section on Oracle so I copied/pasted it into my code changing the pertinent data. Same issue.

After trying several things I discovered that the connection strings for Oracle cannot have a trailing semi-colon.

Data Source=IDWorks;User Id=IDWorks;Password=idw;

Data Source=IDWorks;User Id=IDWorks;Password=idw

Hope this saved you some time!

DataGridViewComboBoxColumn requires multiple clicks to select an item

I am reposting this because I think this guy did a good job posting this. I wish I got to this first! 🙂

DataGridViewComboBoxColumn requires multiple clicks to select an item.

DirectoryOperationException – The object does not exist.

System.DirectoryService.Protocols Library

This was a very frustrating error. I was able to connect to LDAP through LDAPadmin but not through a program I was creating. “The object does not exist” error occurs, at least in my experience when the credentials you are passing to the server do not authenticate.

In this case I was getting nowhere. Resorting to Wireshark, filtering against port 389, which is the port for LDAP resulted in me seeing a backslash in the credentials being passed as well as the username coming after the organization, which is wrong for my environment.

The resolution was to set the domain to nothing in VB or null in C# in my Net.NetworkCredential object. At the same time moving the organization to the username property.

Dim credLDAP As New Net.NetworkCredential(“cn=username”,”password”, “o=domain”)
does not work, but this does:
Dim credLDAP As New Net.NetworkCredential(“cn=username,o=domain”,”password”, nothing)

IIS Frontpage Extensions – You are not authorized to view this page

If you get this error something changed with your environment that is forcing anonymous login to the server. Here is what to do:

Within IIS Manager, right click on the site in which you need access to. Click on the directory security tab. Click on the edit button within Authentication and Access control. Click on Integrated Windows Authentication.

Enjoy! Of course your account will actually need rights to the site in question.

Visual Studio – Data Binding: “The operation could not be completed. Access denied.”

I ran into this problem yesterday and let it go until this morning. I got this error message and had a hard time figuring it out.  Here is a link to the MSDN Forum thread discussing this: http://social.msdn.microsoft.com/forums/en-US/vblanguage/thread/94868d04-de4f-44a9-a362-4ffb1f130bae

This particular thread is specific to Visual Studio Express but is really applicable to all editions of Visual Studio 2005.

The Solution

Open your project’s properties tab.

In the Debug section uncheck “Enable the Visual Studio hosting process”.

This will allow you to find out in more detail what the problem is. In my case I forgot to code in the password in the connection string.

Afterwards, you can check the “Enable the Visual Studio hosting process” option again.