Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# how to fill a datatable

public DataTable GetData()
{
    SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["BarManConnectionString"].ConnectionString);
    conn.Open();
    string query = "SELECT * FROM [EventOne]";
    SqlCommand cmd = new SqlCommand(query, conn);

    DataTable dt = new DataTable();
    dt.Load(cmd.ExecuteReader());
    conn.Close();
    return dt;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: {"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."} 
Csharp :: how to add a gameobject 
Csharp :: how to use navmeshagent in unity 
Csharp :: remove all non alphabetic characters from string c# 
Csharp :: CS0101 Unity Error Code 
Csharp :: c# iterate enum 
Csharp :: particle system start color 
Csharp :: c# how to find character in string 
Csharp :: c# best tutorial 
Csharp :: how to get specific length of row in matrix c# 
Csharp :: Task.FromResult(null) 
Csharp :: c# performance timer 
Csharp :: xmldocument to c# object 
Csharp :: c# generate unique key 
Csharp :: how to cap rigidbody velocity 
Csharp :: unity interfaces 
Csharp :: c# delegate 
Csharp :: how to select time and date in datetimepicker in c# 
Csharp :: c# get excel column number from letter 
Csharp :: list to array c# 
Csharp :: multiplication using arrays 
Csharp :: c# get battery level 
Csharp :: c# new list of objects 
Csharp :: c# linq select as new object 
Csharp :: c# string list 
Csharp :: access object property C# 
Csharp :: Get the Photon Player GameObject 
Csharp :: Write text in Word Document at specific location using C# 
Csharp :: all substrings of a string c# 
Csharp :: meaning immutable and mutable 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =