Click here to Skip to main content
12,551,901 members (53,532 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
My webservice code is here .............

<webmethod()> _
    <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
    Public Function getConfigurationValueByKey(ByVal strKeyName As String) As String
        Dim sqlConnection As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ConnStr").ConnectionString)
        Dim sqlCommand As SqlCommand = New SqlCommand("SELECT * FROM table1 WHERE column1 ='" + strKeyName + "';", sqlConnection)
        Dim sqlDataset As DataSet = New DataSet()
        Dim sqlDataAdapter As SqlDataAdapter = New SqlDataAdapter(sqlCommand)
        Dim MArray()() As String = New String(sqlDataset.Tables(0).Rows.Count)() {}
        Dim i As Integer = 0
        For Each rs As DataRow In sqlDataset.Tables(0).Rows
            MArray(i) = New String() {rs("userid").ToString(), rs("name").ToString()}
            i = i + 1
        Dim js As JavaScriptSerializer = New JavaScriptSerializer()
        Dim sJSON As String = js.Serialize(MArray)
        Return sJSON
    End Function

I want to put userid and name fied to seperate text box .how to get that field from json.
Posted 11-Jul-12 11:32am
Updated 11-Jul-12 11:40am
Wes Aday104.2K

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 11 Jul 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100