SDSlite icon indicating copy to clipboard operation
SDSlite copied to clipboard

Failed to Create Dataset Instance

Open Jeslene opened this issue 1 year ago • 1 comments

Hi, my following code is reflecting error. Try { // open the file and print some info string filePath = "D:\AccessNetCDF\sresa1b_ncar_ccsm3-example.nc"; using (DataSet ds = DataSet.Open("msds:nc" + filePath + "&openMode=readOnly")) { Console.WriteLine(ds); Console.WriteLine(ds.Metadata["comment"]); var lat = ds.GetData<float[]>("lat"); Console.WriteLine($"latitude: len={lat.Length}, min={lat.Min()}, max={lat.Max()}"); }

            Console.ReadLine();
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error reading NETCDF file: {ex.Message}");
            Console.ReadLine();
        }
    }

ERROR: Error reading NETCDF file: Failed to create dataset instance from URI msds;ncD:%5CAccessNetCDF%5Csresalb_ncar_ccm3-example.nc&openMode=readOnly: Provider ncD:%5Csresalb_ncar_ccm3-example.nc&openMode=readOnly is not registered.

Any suggestion where could be possibly wrong?

Thanks, JesC

Jeslene avatar Feb 27 '24 04:02 Jeslene

You just need to install the required software in your PC and register the path in your environment variable and should be working,

kanhayatyagi avatar Apr 11 '24 06:04 kanhayatyagi