Google

Monday, May 12, 2008

Return ArrayList from Web Service

Recently i have tried to return an ArrayList collection from a Web Service.I had to face lots of difficulties.
Whenever i tried to return an ArrayList from my simple web service i got an error saying
"Value of Type '1-dimensional array of Object cannot be converted to System.Collections.ArrayList".
I searched a lot on the internet but found nothing.Then I posted my problem to some forums.
One expert from one forum gave me the solution.and This really works fine for me.

So i m puting the solution here for others

Here is the method code of my simple web service.


_
_
Public Function Test() As ArrayList

Dim lst As New ArrayList

lst.Add("Abc")
lst.Add("bca")
lst.Add("ahy")
lst.Add("fkc")

Return lst

End Sub



and Below is a code for consuming web Service.

Dim ws As New localhost.Service

Dim aList As New ArrayList(ws.Test)

ListBox1.DataSource = aList

Friday, May 2, 2008

Fifteen Cool Features in WPF 3.5

re's a non-exhaustive list of improvements:
  • Performance
    • Fixed animation glitching issues.
    • Layered windows are now hardware accelerated.
    • Many other fixes to improve cold start, data binding, etc.
  • Data Binding
    • Support for XLINQ binding.
    • Improved data validation on binding (ValidatesOnDataErrors and ValidatesOnExceptions binding properties).
    • Much better debugging (PresentationTraceSources.TraceLevel can be set on bindings or providers).
  • Graphics and Text
    • UIElement3D (enables interactive 2D content on 3D surfaces).
    • Improved support for IMEs (input method editors).
    • Indic script support.
    • TextBox now supports a limited undo history.
    • RichTextBox now fully supports inline elements (e.g. a Button).
  • XBAPs
    • Introduced support for the Firefox browser.
    • WCF now operates in partial-trust mode.
    • Can now read/write HTTP cookies.
  • App Model
    • System.AddIn provides support for isolated visual and non-visual add-ins, allowing for discovery, versioning, activation and lifecycle management.

Fix : Error 18452 Login failed for user ‘(null)’. The user is not associated with a trusted SQL Server connection.

Recently i have faced this error.
I have searched a lot on the net and got this solution which is really working.

Error: 18452 Login failed for user ‘(null)’. The user is not associated with a trusted SQL Server connection.

Fix/Solution/Workaround:
Change the Authentication Mode of the SQL server from “Windows Authentication Mode (Windows Authentication)”
to “Mixed Mode (Windows Authentication and SQL Server Authentication)”.

Run following script in SQL Analyzer to change the authentication

ALTER LOGIN sa ENABLE
GO
ALTER LOGIN sa WITH PASSWORD =
GO

OR

In Object Explorer, expand Security, expand Logins, right-click sa, and then click Properties. On the General page, you may have to create and confirm a password for the sa login. On the Status page, in the Login section, click Enabled, and then click OK.