c# - Does a DataSets DataTable inherit structure when no records exist? -


i'm hooking dataset sql ce 3.5 database , chasing down exception (nullref). think issue may caused empty dataset i'm struggling understand way in structure of datatable works.

if populate dataset against table structure exists, no records have been added, standard behavior? datatable of matching structure instantiated or dataset left empty? (assuming database contains 1 table i'm connecting in case).

edit: cheap example

database "contacts" 1 table "mycontacts". has 4 fields, contactid, name, phone, email (int, nvarchar x3)

            dataset data = new dataset()     sqlceconnection connection = new sqlceconnection();              sqlcedataadapter adapter = new sqlcedataadapter("select * mycontacts ", connection);             sqlcecommandbuilder builder = new sqlcecommandbuilder(adapter);             adapter.fill(data, mycontacts);             return data; 

what happends if table exists (its structure present) there no records?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -