Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dataadapter insert
Message
De
26/09/2013 17:44:16
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Dataadapter insert
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01584280
Message ID:
01584280
Vues:
44
Hi All -

I am still experimenting with some things that are new (to me). In this case it's the dataadapter. I have a very elaborate SQL Select statement that produces a Gridview like this:
Dim oConn As New SqlConnection(ConfigurationManager.ConnectionStrings("TRPConnectionString").ConnectionString)
oConn.Open()

Dim adapter As New SqlDataAdapter(SQL, oConn)
Dim dt As New DataTable()
adapter.Fill(dt)

GridView2.DataSource = dt
GridView2.DataBind()
My problem is that before I display the table in the Gridview, I need to add a few more rows. I have read about the adapter INSERT command but can't figure out how to reference the table. When I tried 'INSERT INTO dt . . . ', it failed. I will also need to reorder the table after the additional rows are added. I haven't a clue how to do that either. Can this even be done? There is no need to send data back to the source tables since the primary SQL involves a dynamic PIVOT. The end game here is to get some data into the Gridview so it can ultimately be exported to Excel.

Thanks in advance for your help.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform