Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

c# Select MSSQL

DataSet ds = new DataSet();
//https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/ODPNET_Core_get_started/index.html
using (SqlConnection con = new SqlConnection(connectionstr))
{
    using (SqlCommand cmd = con.CreateCommand())
    {
        con.Open();
        cmd.CommandText = "select * from master.sys.server_principals";
        SqlDataAdapter adapter = new SqlDataAdapter(cmd);
        adapter.Fill(ds);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Select #MSSQL
ADD COMMENT
Topic
Name
4+9 =