For Answers, see/post comments

Share folder

hi,
i created one share folder in my system.
i watn to use that sharefolder in another system.
i logged on another system.
i want that share folder in this system what to do?

Double Buffering

i want toget information regading doublebuffering...
i heard this concept can be used for flickerless image draws...
get me some useful websites where i can get information about the same...
thank u in advance...:)

Server.transfer Vs response.redirect?

What is the difference between server.transfer and response.redirect?

What is deployment?

Hi.
I want to know the below definition if it's Wright or Wrong?
Deployment : means copying the new build pages into the previously designed application without webconfig file.
Is Itcorrect???

Datagrid Problem

i placed datagrid in my from.....
and i have add buton ..
i have to type the values in the datagrid and insert it into my table
i am using windows application and code behind is c#.....
can any one help me?

Need DLL

Where i can download the DLL Microsoft.Office.Tools.Excel.v9.0.dll?
Help Me

Thanks in Advance.

Get IP address

How to get IP address of own PC using the VB.NET code ?

string myHost = System.Net.Dns.GetHostName();
string str = System.Net.Dns.GetHostByName(myHost).AddressList[0].ToString();

Public Function GetIPAddress() As String
Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)
Return h.AddressList.GetValue(0).ToString
End Function

http://www.advancescripts.com/detailed/2180.html
http://aspdotnetcodebook.blogspot.com/2008/04/how-to-get-ip-address-to-countrystate.html

Throwing an error

Consider the following code snippet

int a, b = 0 ;
Console.WriteLine( "My program starts" )
try
{
a = 10 / b;
}
finally
{
Console.WriteLine ( "finally" ) ;
}
Console.WriteLine ( "Remaining program" ) ;


Here the output is
My program startsException occurred: System.DivideByZeroException: Attempted to divide by zero.at ConsoleApplication4.Class1.Main(String[] args) in d:\programs\consoleapplication4\class1.cs:line 51 finally
Note that "Remaining program" is not printed out. Only "finally" is printed which is written in the finally block.

The throw statement throws an exception. A throw statement with an expression throws the exception produced by evaluating the expression. A throw statement with no expression is used in the catch block. It re-throws the exception that is currently being handled by the catch block.

Consider the following program:
int a, b = 0 ;
Console.WriteLine( "My program starts" ) ;
try
{
a = 10 / b;
}
catch ( Exception e)
{
throw
}
finally
{
Console.WriteLine ( "finally" ) ;

The output here is:
My program startsException occurred: System.DivideByZeroException: Attempted to divide by zero.at ConsoleApplication4.Class1.Main(String[] args) in d:\programs\consoleapplication4\class1.cs:line 55 finally


This shows that the exception is re-thrown. Whatever is written in finally is executed and the program terminates. Note again that "Remaining program" is not printed.

How can i split the sting in C#.Net

I have a string and i want to split the string in two part.f
or example

i have a string like "SNP_A-1998569 2 3 4 5 1 0 4 2 3 1 4 0"
and i want only "SNP_A-1998569".
how can i do it in C#.Net

which function i can use to get the desired string

can u give me the code.

SSIS OnError Event Handler - How to Retrieve Error Information (Number, Description, Source)

Now that I've figured it out it seems obvious, but I had to struggle a little when creating my first OnError event handler in SQL Server 2005 SSIS. I couldn't figure out how to access the error information that triggered the event. Here's how:

Method A: Expose With the Script Task Editor

You can use the ReadOnlyVariables field on the Script Task Editor to expose these three variables:
ErrorCodeError
Description
SourceName

Then you can read these values from the Dts.Variables collection. Don't use the @ symbol in front of the variable name. To list multiple variables for ReadOnlyVariables, separate them by a comma.

Method B: Get them through code
Some people may prefer to not us ReadOnlyVariables since it creates an dependency external to the script code itself. You can retrieve this variables programatically, but like my LockOneForWrite example it takes some verbose code. Here's some example code I'm using, which uses an extra procedure in the script to retrieve the system variables:

Public Sub Main()
'Assume success
Dts.TaskResult = Dts.Results.Success
Try
Dim errNumber As Integer
Dim errDescription As String
Dim errSource As String

GetErrorValues(errNumber, errDescription, errSource) System.Windows.Forms.MessageBox.Show( _
errNumber.ToString() + vbNewLine + vbNewLine + _
errDescription + vbNewLine + vbNewLine + _
errSource)

Catch ex As Exception
' Displaying the error since this is an example.
System.Windows.Forms.MessageBox.Show(ex.ToString())
End Try

End Sub

Private Sub GetErrorValues(ByRef errNumber As Integer, _
ByRef errDescription As String, ByRef errSource As String)

Try
Dim vars As Variables
Dts.VariableDispenser.LockForRead("ErrorCode")
Dts.VariableDispenser.LockForRead("ErrorDescription")
Dts.VariableDispenser.LockForRead("SourceName")
Dts.VariableDispenser.GetVariables(vars)

Try
errNumber = CType(vars("ErrorCode").Value, Integer)
errDescription = vars("ErrorDescription").Value.ToString()
errSource = vars("SourceName").Value.ToString()

Catch ex As Exception
Throw ex
Finally
vars.Unlock()
End Try
Catch ex As SystemException
Throw ex
End Try
End Sub

Notice how the GetErrorValues() procedure returns the error information via ByRef arguments. Feel free to copy the code.