Note that there are some explanatory texts on larger screens.

plurals
  1. POC# - Drive is not Ready (DriveInfo)
    primarykey
    data
    text
    <p>I have this small problem with the DriveInfo Class. I know that the error is specific to the "IsReady" Property but I just don't know how to define it..</p> <pre><code>namespace Csp.Test.ConsoleApp { public class Program { public static void Main() { //Create the server object - You will need create a list of the server objects. Server server = new Server(); //Get all drives information List&lt;DriveInfo&gt; driveList = DriveInfo.GetDrives().ToList&lt;DriveInfo&gt;(); //Insert information of one server - You will need get information of all servers server.ServerID = 0; //Here is necessery put PK key. I recommend doing the SQL server will automatically generate the PK. server.ServerName = string.Concat("Server ", driveList.Count); //Inserts information in the newServers object for (int i = 0; i &lt; driveList.Count; i++) { ServerDrive serverDrives = new ServerDrive(); //Put here all the information to obeject Server serverDrives.DriveLabel = driveList[i].Name; serverDrives.TotalSpace = driveList[i].TotalSize; serverDrives.DriveLetter = driveList[i].VolumeLabel; serverDrives.FreeSpace = driveList[i].TotalFreeSpace; // server.ListServerDrives.Add(serverDrives); server.ServerDrives.Add(serverDrives); } //Add the information to an SQL Database using Linq. DataClasses1DataContext db = new DataClasses1DataContext(@"sqlserver"); // db.Servers.InsertAllOnSubmit(server); db.Servers.InsertOnSubmit(server); db.SubmitChanges(); } </code></pre> <p>Any help would be greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload