Looking for a Gridview example using a sqldatasource

Looking for a Gridview example using a sqldatasource

CoolinJackCoolinJack Posts: 4Questions: 2Answers: 0

Hi All

I am using a Gridview to display data connected to an sqldatasource,
the app uses a business layer to call back to the DB and returns a datatable

I really want to use the DataTables formatting on the grid as they look awesome !.

I would appreciate some guidance / advise here

Thanks in Anticipation, -Colin

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin

    Are you able to read the data from the sql data source? Can you return it to the client-side as JSON? If so this section of the manual should help.

    If you can't read the data from the data source yet, then you'd need to refer to the support channels for whatever server-side environment it is that you are using.

    Allan

  • CoolinJackCoolinJack Posts: 4Questions: 2Answers: 0

    I am using a JasonConverter as Shown

    output = JsonConvert.SerializeObject(Client)

    "{""ClientID"":""00001"",""Title"":""Mr."",""City"":""Quesnel"",""Gender"":null,""lastname"":""Millard"",""firstname"":""Colin"",""phonenum"":""250 991 5300""}"

    However this also fails to import properly, any guidance on the best way to format the data so as it can be processed correctly ?

    I am moving forward with this project !

    Thanks

    C

  • tangerinetangerine Posts: 3,348Questions: 36Answers: 394

    The accepted JSON formats for DataTables are explained in the link Allan gave you.

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Answer ✓

    That doesn't look like valid JSON. How does it render if you look at in your browser's Network inspector?

    Also, you need an array of items for DataTables. Each index in the array (be it another array or an object) is a row in the table.

    Allan

This discussion has been closed.