Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi. I am trying to make a function that could open tables in a database getting its noun, and i have no idea how to do it....

 

 

BDatos= new SqlConnection(S"data source=(local);"

S"integrated security=false;User ID=SA;password=xxx;"

S"initial catalog=Laboratorios");

 

The idea is to do something similar to this...

 

SqlDataAdapter* DataAdapter(String *Prueba)

{

SqlDataAdapter *sqlDataAdapter;

sqlDataAdapter= new SqlDataAdapter(

"SELECT *FROM Prueba", BDatos);

}

 

The idea is to take Prueba as a variable, but i don´t know how to do that.

I would appreciate any help.

Thanks.

Adolfo.
Posted

Don't really follow your code C++ too long in the past:(

 

But if I understand you right in VB I would do....

 


Dim strTableName As String = "AnyOldTable"

Dim strSQL As String = "SELECT * FROM" & strTableName & ";"

My website

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...