Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

unable to evaluate expression error in the below code ??

$
0
0

long maximumBytesForSiteCollection;
maximumBytesForSiteCollection = Convert.ToInt32(ddlQuota.SelectedValue.Split(' ')[0]) * 1024 * 1024;

SPSite _newsc = new SPSite(newSiteCollURL);
SPQuota quota = _newsc.Quota;
quota.StorageMaximumLevel = Convert.ToInt32(ddlQuota.SelectedValue.Split(' ')[0]) * 1024 * 1024;
quota.StorageWarningLevel = (long)(0.75 * Convert.ToInt32(ddlQuota.SelectedValue.Split(' ')[0]) * 1024 * 1024);
_newsc.Quota = quota;

sharepoint is throwing the error at "quota.StorageMaximumLevel = Convert.ToInt32(ddlQuota.SelectedValue.Split(' ')[0]) * 1024 * 1024;" line.

what exactly i was doing here is.. creating a site colelction programmatically and assigning quota to newly created sitecollection.

i was able to create the sitecollection properly butwhile assigning the quota, this is the error message i am getting.

i couldn't figure out exactly what this means.

Thanks

Bob


Viewing all articles
Browse latest Browse all 25064

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>