473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Server Space issue not able to find out the total space and free space of the server

Hi,

I would like find out the server space of the server location as \\ad1hfdtfs001\. I am able to find the Disk space of my local computer. But i am not able to find out the server space for this. Any one please throw some light on this.Any help would be appreciated.

Server Path i want to find out the space is \\ad1hfdtfs001\WebApps\CE_DEV

public void GetvaluesfromArray(string[] getdetails)
{

Nasspace Call = new Nasspace();
string ServerName = getdetails[0];




System.IO.DriveInfo drive = new System.IO.DriveInfo(getdetails[1]);
System.IO.DriveInfo a = new System.IO.DriveInfo(drive.Name);
long Storagenew = a.TotalFreeSpace;



double Storage = ConvertBytesToMegabytes(Storagenew);



//Sarath Adding Method for the Total Space Available

Int64 Toatalspacenew = FreeSpaceissue(getdetails[1]);

double Toatalspace = ConvertBytesToMegabytes(Toatalspacenew);

Int64 Totalvalue = Convert.ToInt64(Toatalspace);

Call.Updatedatabase(ServerName, getdetails[1], Storage, Totalvalue);

}


[WebMethod(Description = "Getdata from the sqldatabase")]
public DataTable Getdetails()
{




Nasspace arr = new Nasspace();
DataSet ds = new DataSet();
SqlConnection sqlCon = new SqlConnection();
SqlDataAdapter sqlAdp = new SqlDataAdapter();
sqlCon.ConnectionString = ConfigurationManager.ConnectionStrings["MSAPConnectionstring"].ConnectionString;
try
{

sqlCon.Open();

sqlAdp = new SqlDataAdapter("select nvarchar1, nvarchar3 FROM userdata where tp_Listid = 'D5B5FA6F-D8E6-4710-8EE6-EBF93ACE2FBF'", sqlCon);

sqlAdp.Fill(ds, "userdata");

foreach (DataTable thisTable in ds.Tables)
{
foreach (DataRow row in thisTable.Rows)
{


object[] values = row.ItemArray;
string[] str = Array.ConvertAll<object, string>((object[])values, Convert.ToString);



arr.GetvaluesfromArray(str);

}
}
sqlCon.Close();


return ds.Tables[0];
}
catch (Exception ex)
{
// log this exception or throw it up the StackTrace
// we do not need a finally-block to close the connection since it will be closed implicitely in an using-statement
throw;
}
}


Regards,
Sarath
Dec 3 '13 #1
0 1174

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: ACP | last post by:
Hi all, Have a situation that my company has never run across before. Client is running NT4 for the domain server, using terminal services 2000 and running an application with a SQL Server...
2
by: niradjoshi | last post by:
I made two SQL Server 2000 as linked server using same remote login These both server are running on different Domain Configuration Detail 1. Server A - MS SQL Server 2000 SP4, windows 2003...
1
by: mcasaurabhsumit | last post by:
Hi friend, I am unable to get last record in sql server 2000. How to find last record in sql server 2000?
1
by: Miguel Pires | last post by:
Hi, Any one knows a way to get Hard Drive letters and free space (C: / D: ....) from a remote computer? I'm developing one application that needs to know if a second drive exist on that system...
1
by: gravikrishna | last post by:
hello sir pls tell me the code of my question how do u find total text of a html page in .net
4
by: selvialagar | last post by:
I am doing a project in embedded system (in vc++.net 2003)...I need to allocate a pool of free space for the incoming packets.Once i received the packet in the pool, an intimation must be given to me...
6
by: SRK | last post by:
Hi, I have installed free TDS ODBC driver on Linux and from there I am trying to connect to MS SQLSERVER installed on Windows machine. But it gives me following error - tsql -H ps6312 -p 1433...
1
Claus Mygind
by: Claus Mygind | last post by:
I am trying to setup another web server. It is running apache 2.2.10 on an XP Professional OS platform with dBase 2.6.1.3 build 2059 BDE 5.2.0.2 On some of my server side apps, I read the...
2
by: karimufeed | last post by:
I am working on an access project for pension calculation. I want to find total length of service between two dates. i.e. if the Date of entry into service is 15/3/1980 and the date of retirement...
4
by: sachin30 | last post by:
Hi, I have a disk number and partition number. using this information i want to find out how much free space available on that partition and what is total size of partition? this thing...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.