how to get share calendar list in exchange 2007 - calendar

I am using glen's code(EWS - Access All Shared Calendars) to get share calendars, it work fine on exhange 2010/2013/office365. but get error on exchange 2007.the code has error like this:
psPropset.Add(PidTagWlinkAddressBookEID);
ItemView iv = new ItemView(1000);
iv.PropertySet = psPropset;
iv.Traversal = ItemTraversal.Associated;
the ItemTraversal.Associated only support on exchange 2010, not support exchange 2007.
can anyone help me? very thanks.

Related

msadox28.tlb is not a valid .Net assembly file while registering it

I am developing application with vb.net (2015) and MS Access database. I can work fine with existing database. I have now situation where I need to create database programmatically, for billing purpose. It is the situation where each folder will contain database for company/firm selection.
After searching on the internet / StackOverflow I learned about ADOX. Even got the ready code for it. I applied it in my coding.
Adding reference of Microsoft ADO extend 2.8 and 6.0
Created variable Adx as new Adox.catalog
Then finally wrote Adx.create(olejet provider conn string with data source)
In this step I get an error
COM Class not registered
So I tried to register msadox.dll and msadox28.tlb with regsvr32 and regasm but at that time I get another error:
msadox.dll get registered successfully but error gives in msadox28.tlb
Fail to load -file- becuase it is not a valid .net assembly file
Now I am stuck at this point.
My system is Windows 10 64 bit. I tried to target cpu x86, and any cpu but it didn't work. I got many questions and answer here but didn't understand it.
EDIT:
I tried following connection string and it worked, but it creates old 2000-2003 mdb file. i want to use new access file .accdb
String is :
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\VBProj\Testing\test.mdb;Jet OLEDB:Engine Type=5
EDIT : on 20/9/2021 - MON
First of all Thank you very much #Jimi, your suggestion to use ACE.16 and cleaning solution worked. Thanks a lot
I use the following steps to create MS Access database using ADOX in VB.NET:
Project Menu > Add Reference > COM Section > Select Microsoft ADO Ext. 6.0 for DLL and security
Write connection string at program entry point (form load/sub main) -> Provider=Microsoft.ACE.OLEDB.16.0;Data Source=D:\VBProj\Testing\test.accdb, assign it to variable connString
Declare adox catalog globally like Public gAdxCat As New ADOX.Catalog
Use its method gAdxCat.create(connString)
That's all - DONE
Again thanks to #jimi
This is the answer to my question (helped by #jimi)
following are the steps to create msaccess database using ADOX in VB.NET and error occurs mention in original questions.
1-Project Menu > Add Reference > COM Section > Select Microsoft ADO Ext. 6.0 for DLL and security (remove ref of 2.8)
2-write connection string at program entry point (form load/sub main) -> "Provider=Microsoft.ACE.OLEDB.16.0;Data Source=D:\VBProj\Testing\test.accdb" assign it to variable connString
3-declare adox catalog globally like Public gAdxCat As New ADOX.Catalog
4-User its method gAdxCat.create(connString)
5-Thats all DONE
again thanks to #jimi

var data = Database.Open("databasename").Query("SELECT * FROM table); visual studio

I know you can do this in web matrix and it works fine
var data = Database.Open("databasename").Query("SELECT * FROM table); visual studio
but how can you achieve something similar in visual studio 2010 using MVC3???
I need to be able to loop through table rows using a foreach() and implement them through an api, I originally started the project in web matrix, but was asked to use mvc in visual studios instead, i have limited knowledge with it. I am using Microsoft sql server.
Also if anyone thinks I might be going the complete wrong way about achieving this, any input to point me in the right direction would be appreciated.
I've found that the ORM which most closely resembles WebMatrix is Dapper.
https://github.com/StackExchange/dapper-dot-net
It can be used with dynamic objects in a very similar manner to WebMatrix, but can also be used with strongly typed objects if you wish. It's available as a NuGet package.
The code in your question would end up looking something like the following in Dapper:
using (var con = new SqlConnection(WebConfigurationManager.ConnectionStrings["databasename"].ConnectionString))
{
var data = con.Query("SELECT * FROM table");
foreach (var row in data)
// do stuff
}

How to display XML-RPC.Net Server instance data in the UI?

We've trying recently to use XML-RPC.Net library on our project.
Both server(.Net Remoting) and client have been made according to the instructions we've found on http://xml-rpc.net/.
The connection has been made, we obtain data from the server and so on.
As the title states, now, we'd like to know how to make our XML-RPC server instance, which is created after the first client call, be able to give feedback to a WPF UI.
What we'd like to accomplish is to register an event on a server property so the call could arrive to the UI thread.
We are open to any suggestions in this regard.
Here is the code that registers the channel on server side:
IDictionary props = new Hashtable();
props["name"] = "SubsetHttpChannel";
props["port"] = 5678;
channel = new System.Runtime.Remoting.Channels.Http.HttpChannel(
props,
null,
new XmlRpcServerFormatterSinkProvider()
);
ChannelServices.RegisterChannel(channel, false);
RemotingConfiguration.RegisterWellKnownServiceType( typeof(SubsetServer), "subsetserver.rem", WellKnownObjectMode.Singleton);
This is the code that shows how we'd like to set the property after Server instance is created on the UI:
Server = new SubsetServer();
Server.Machine.OnChangeState += delegate(State actual, State next, Event pEvent)
{
uiWindowInstance.PostMessage(string.Format("Subset Server: {0} -> {1}", actual.Name, next.Name));
};
Technologies used: VS2012, WPF 4.5 and XML-RPC.NET 2.5.0
Thanks in Advance
Thanks to anyone that took the time to read it and try to answer.
I found a solution that fits me for the moment. I'd like to share it with you in the hope someone could give any hints wheter this is a solution that may generate problems in the future.
After analyzing, I found out that both server instances run in the same process. So I've created a Singleton as a property inside my Server.
I've put whatever I need inside the Singleton, so for the delegate I'd like to use in my question, the code now is:
Server = new SubsetServer();
Server.**singleton**.Machine.OnChangeState += delegate(State actual, State next, Event pEvent)
{
uiWindowInstance.PostMessage(string.Format("Subset Server: {0} -> {1}", actual.Name, next.Name));
};
Hope this helps anyone else.
Please comment if you find any flaws.

4004 RIA Service error - Remote database

After finaly be abble to setup my silverlight app with RIA, I call the following code to get my list of citie objects from my remote database:
_context = context;
var load =_context.Load(_context.GetCitiesQuery());
_cities = new ObservableCollection<City>(load.Entities);
I get no errors, but also no data. After using fiddler I do see that I get a responce looking like this:
#GetCitiesResponsehttp://tempuri.org/#GetCitiesResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^
TotalCount�^
RootResults b4http://schemas.datacontract.org/2004/07/Gymsport.Web_City_CityID�_CityName�Oelegem_PostCode�� _City_CityID�_CityName�Ranst_PostCode�� _City_CityID�_CityName�Emblem_PostCode�� _City_CityID�_CityName�Ranst_PostCode��
Which is a lot of rubbish, but between the lines you can read it returns a couple of cities.
But for some reason my silverlight app doens't pick up on those.
Any suggestions on how to look for a solution?
Thanks in advance.
Grtz
T
Solution:
I had to work with the EntityList object to convert the result of the query to an observable collection. Thank you Firefox ErrorConsole :)

Com Interop problem Silverlight 4 and MS Access 2010

I am trying to launch an existing MS Access database (Access 2010) from a Silverlight 4 OOB with elevated authorisation set. I keep getting an error. I can create a new Access application using the CreateObject keyword, but when I try to launch an existing one I get an error: "No object was found registered for specified ProgID."
Any help is appreciated. Here is the code I use:
string sMSAccess = "C:\\Users\\storltx\\Documents\\SL4Demo.accdb";
dynamic MSAccess = ComAutomationFactory.GetObject(sMSAccess);
MSAccess.Visible = true;
I think you should pass "Access.Application" string to GetObject call. like this:
dynamic MSAccess = ComAutomationFactory.GetObject("Access.Application");
Try your code like this:-
string sMSAccess = "C:\\Users\\storltx\\Documents\\SL4Demo.accdb";
dynamic app = ComAutomationFactory.CreateObject("Access.Application");
app .Visible = true;
app.OpenCurrentDatabase(sMSAccess);

Resources