How to create a graph in C# using SQL Server database? -
i'm using sql server
database , c#
form, want create graph
in c# form database data.
i use msdn sample codes didn't work; no error , no response!
thank helping me ;)
// access database string filenamestring = "data\\chartdata.mdb"; // initialize connection string string myconnectionstring = "data source=" + filenamestring; // define database query string myselectquery="select name, sales reps ;"; // create database connection object using connection string sqlconnection myconnection = new sqlconnection(myconnectionstring); // create database command on connection using query sqlcommand mycommand = new sqlcommand(myselectquery, myconnection); // open connection mycommand.connection.open(); // create database reader sqldatareader myreader = mycommand.executereader(commandbehavior.closeconnection); chart1.series["default"].points.databindxy(myreader, "name", myreader, "sales"); // close reader , connection myreader.close(); myconnection.close();
you can install , use reporting services create graph report , dashboard.
Comments
Post a Comment