- [System.Web.Services.WebMethod]
- public void loaddata()
- string sql = "SELECT Name,Time,Inuse FROM table4";
- using (SqlConnection Connection = new SqlConnection((@"Data Source)))
- {
- using (SqlCommand myCommand = new SqlCommand(sql, Connection))
- {
- Connection.Open();
- using (SqlDataReader myReader = myCommand.ExecuteReader())
- {
- DataTable dt = new DataTable();
- dt.Load(myReader);
- Connection.Close();
- DataView dv = new DataView(dt);
- dv.RowFilter = (("Name='ACVX'"));
- var tableEnumerable = dv.ToTable().AsEnumerable();
-
- var tableArray = tableEnumerable.ToArray();
- return tableArray ;//Error
- }
- }
- }
-
- }
I Want to load my datatable into an Var Array and Return the array .suggest some ideas to do my TASK..