|
Does your Excahnge implementation have EWS 2007 installed? If not, this isn't going to work at all.
|
|
|
|
|
Hi Dave,
Yes, I am able to enumerate the folder names now and get the item count for each folder, but I cannot figure out how to convert the folder names to an item list to try and load the extended properties for each folder name.
|
|
|
|
|
Update:
I'm able to get it working, but only for my own mailbox? Any ideas? I can get it to attempt other users, but I get a permissions error. I'm an exchange org admin and full admin so I'm not sure why that would be?
private static readonly ExtendedPropertyDefinition PidTagMessageSizeExtended
= new ExtendedPropertyDefinition(0xe08, MapiPropertyType.Long);
private void button1_Click(object sender, EventArgs e)
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new WebCredentials("[account]", "[password]", "[domain]");
service.AutodiscoverUrl("emailaddress@domain.com");
int moffset = 0;
int mPageSize = 500;
FolderView view = new FolderView(mPageSize, moffset, OffsetBasePoint.Beginning);
view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
view.PropertySet.Add(FolderSchema.DisplayName);
view.PropertySet.Add(FolderSchema.ChildFolderCount);
view.PropertySet.Add(FolderSchema.TotalCount);
view.PropertySet.Add(FolderSchema.UnreadCount);
view.Traversal = FolderTraversal.Deep;
FindFoldersResults folders = service.FindFolders(WellKnownFolderName.MsgFolderRoot, view);
var offset = 0;
const int pagesize = 500;
long size = 0;
FindFoldersResults foldersNew;
do
{
foldersNew = service.FindFolders(WellKnownFolderName.MsgFolderRoot,
new FolderView(pagesize, offset, OffsetBasePoint.Beginning)
{
Traversal = FolderTraversal.Deep,
PropertySet =
new PropertySet(BasePropertySet.IdOnly, PidTagMessageSizeExtended,
FolderSchema.DisplayName)
});
foreach (var folderNew in foldersNew)
{
object folderSize;
if (folderNew.TryGetProperty(PidTagMessageSizeExtended, out folderSize))
{
int bytes = Convert.ToInt32(folderSize);
int megaBytes = (bytes / 1048576);
size += megaBytes;
MessageBox.Show(folderNew.DisplayName + ": " + megaBytes + ", total mailbox size: " + size);
}
}
offset += pagesize;
} while (folders.MoreAvailable);
}
modified 30-May-12 16:54pm.
|
|
|
|
|
It appears it is because my CAS box doesn't have impersonation rights ... can anyone confirm this?
|
|
|
|
|
I'm no Exchange expert so I couldn't tell you. I also don't have an installation I can test any code against.
|
|
|
|
|
Hi,
I am having problem with the validation summary. I have radiobuttons where I kept requiredFieldValidation and all these are inside the gridview like shown below:
<asp:panel id="pnlEval" runat="server" enabled="false">
* Denotes required entry
<asp:validationsummary id="ValidationSummary" runat="server" forecolor="" headertext="<p class="valSummaryHeader">Please correct the following:</p>">
<div class="questionHeader">
<asp:label id="lblQHeader" runat="server" text="Questions" cssclass="question">
<asp:label id="lblAns1" runat="server" cssclass="answer">
<asp:label id="lblAns2" runat="server" cssclass="answer">
<asp:label id="lblAns3" runat="server" cssclass="answer">
<asp:label id="lblAns4" runat="server" cssclass="answer">
<asp:label id="lblAns5" runat="server" cssclass="answer">
</div>
<div class="questionDetails">
<asp:label id="lblQues1" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest1" runat="server" controltovalidate="radAns1"
="" errormessage="All the questions must be answered" cssclass="valError" display="Static" forecolor="">!
<asp:radiobuttonlist id="radAns1" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<div class="questionDetails">
<asp:label id="lblQues2" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest2" runat="server" controltovalidate="radAns2"
="" errormessage="All the questions must be answered" cssclass="valError" display="Dynamic" forecolor="">!
<asp:radiobuttonlist id="radAns2" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<div>
<asp:label id="lblQues3" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest3" runat="server" controltovalidate="radAns3"
="" errormessage="All the questions must be answered" cssclass="valError" display="Dynamic" forecolor="">!
<asp:radiobuttonlist id="radAns3" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<div>
<asp:label id="lblQues4" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest4" runat="server" controltovalidate="radAns4"
="" errormessage="All the questions must be answered" cssclass="valError" display="Dynamic" forecolor="">!
<asp:radiobuttonlist id="radAns4" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<div>
<asp:label id="lblQues5" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest5" runat="server" controltovalidate="radAns5"
="" errormessage="All the questions must be answered" cssclass="valError" display="Dynamic" forecolor="">!
<asp:radiobuttonlist id="radAns5" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<div>
<asp:label id="lblQues6" runat="server" cssclass="question">
<asp:requiredfieldvalidator id="rfvQuest6" runat="server" controltovalidate="radAns6"
="" errormessage="All the questions must be answered" cssclass="valError" display="Dynamic" forecolor="">!
<asp:radiobuttonlist id="radAns6" repeatdirection="Horizontal" runat="server" cssclass="answerGroup">
<asp:listitem value="1" text="">
<asp:listitem value="2" text="">
<asp:listitem value="3" text="">
<asp:listitem value="4" text="">
<asp:listitem value="5" text="">
</div>
<asp:button id="btnSubmit" runat="server" text="Submit" onclick="btnSubmit_Click">
And now when i run the program, even before i click the submit button, the validation summary is showing. I want this summary to show only after I click the submit button and if there is any radio button unchecked.
Can anyone tell me where I have done mistake?
<div class="signature">suchita</div>
|
|
|
|
|
I don't know ASP, so can't comment. Though, apart from accidentally wrapping the last part of your question in the pre tags, there is one thing that's perhaps (hopefully) a mistake.
You might notice that this is a C# forum. Clearly your code is ASP.
Perhaps you'd get a better response if you posted it here[^]
|
|
|
|
|
|
Couldn't you just set the caption to "PINview +"?
/ravi
|
|
|
|
|
I have an icon that I want to use
|
|
|
|
|
|
There's an article on CodeProject[^] how to draw in the title bar of a form.
Bastard Programmer from Hell
|
|
|
|
|
|
You're welcome
|
|
|
|
|
Not sure why this got a downvote, it's not a trivial 'gimme codez' question.
|
|
|
|
|
Hello!
I cannot change the password in System.Data.Sqlite DB.
Here is the code:
_DB = new SQLiteConnection("Data Source=" + db + String.Format(";Password={0}",
Convert.ToBase64String(password)));
Later I do this:
_DB.SetPassword(Convert.ToBase64String(newPassword));
But when I open the DB again, I get the error:
"File is encrypted or is not a database..." - the same when open with wrong password.
But after changing the password this way, the DB is still OK until application close.
If I do:
_DB.Open();
_DB.ChangePassword(Convert.ToBase64String(password));
_DB.Close();
I cannot access DB after this.
|
|
|
|
|
amrok2amrokk wrote: _DB.SetPassword(Convert.ToBase64String(newPassword));
This line isn't intended to change a password. In SqlLite, you use this to set the password for the database before you issue the Open command.
|
|
|
|
|
Well, it seems
SetPassword() has to be issued before every
Open() after
ChangePassword() has been called.
|
|
|
|
|
There is something strange going on. It's written in documentation:
SQLiteConnection.Open Method
Opens the connection using the parameters found in the ConnectionString
But when I change the password
DB.Open(); DB.ChangePassword("newpass"); DB.Close(); and change the password parameter in connection string, I still cannot decrypt DB with new password.
|
|
|
|
|
So I fixed that: changed Base64 string to UTF8 and with update of ConnectionString it works now.
Thanks
|
|
|
|
|
private DataTable AddNewRowToGrid()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
drCurrentRow = dtCurrentTable.NewRow();
dtCurrentTable.Rows[i - 1]["EffectFrom"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[1].FindControl("txtEffectFrom")).Text;
dtCurrentTable.Rows[i - 1]["EffectivePercentage"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[2].FindControl("txtEffectivePercentage")).Text;
dtCurrentTable.Rows[i - 1]["Grade_Salary"] = ((TextBox)mdlpopupGrid.Rows[rowIndex].Cells[3].FindControl("txtGradeSalary")).Text;
rowIndex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrentTable"] = dtCurrentTable;
return dtCurrentTable;
}
}
}
This code gives me the Fallowing Error:
Not all code paths return a value plss Help !!
|
|
|
|
|
insert return null; before the last }
|
|
|
|
|
Can SARIGÜL wrote:
insert return null; before the last }
not working actually
I want this Function result to be used as Datatable to fill a Gridview.
return null will work
|
|
|
|
|
The reason it's given you this message is because you have the condition to test if the ViewState is not null. What happens if ViewState["CurrentTable"] is null? (You have a similar issue if dtCurrentTable.Rows.Count == 0 . To fix this, return an empty DataTable from the method (most style guides recommend not returning null).
|
|
|
|
|
Add:
else
{
return null;
}
before last '}'.
|
|
|
|