Goodmorning to all!
Ehm i want create a button ribbon and when i press it load a windows form integrated into outlook 2010 or 2007 or 2013 (if it exited from building). Ehm i started creating button ribbon with this guide:
When i press it i would load a form into outlook that load all contacts of my public folder with this name "Contatti Itech" into a datagrid view.
How can i do it?
Plz help me!
Thanks for any help! Code are appreciated too!!!
The long string [000000001A447390AA6611CD9BC800AA002FC45A0300D4985F464F07654AA9CA8D6B785E166E000000004E3B0000] is id for my public folder. Is there anyway to get public folder by name such as "Contatti Itech"?
I am trying to convert the string to datetime including the milliseconds... unfortunately when I used the Convert.ToDateTime method, it does not return the milliseconds... I have tried the parse and parseExact method in the Datetime and DateTimeOffset classes as well... none of them returning the milliseconds... I read the previous discussion regarding this issue and none of the solutions return the milliseconds...This is what I am trying to do:
Thank you so much for taking your time to respond to my post... I really appreciate it... but the solution both of you mentioned does not work for my situation... may be I did not state my question clearly... I apologize for that...
Pete, in your solution, you are converting the date to string again... that's not what i want...
And BMS121, I used the 'TimeOfDay' property as you suggested , but I could not assign that to datetime variable... I get compiler error :'Cannot implicitly convert System.TimeSpan to System.Datetime...
This is what I want to accomplish:
I am getting the datetime as a string from client ... so I have to convert that string to datetime including millisecond and then I have to store/save that datetime in the database (the datebase column is datetime type)...
Here is the code snippet:
string strDate = "2012-11-09 07:20:07.410"
Datetime actualDate = Convert.ToDateTime(strDate); -(L2)
L2 : does not return millisecond...
As per BMS121 suggestion, I tried the following :
(my entity object is called EDEntitiy)
Edentity.Timestamp = actualDate.TimeOfDay;
But above statement causes compiler error:
'Cannot implicitly convert System.TimeSpan to System.Datetime...
You are misunderstanding Pete's solution. Convert.ToDateTime is already giving you the right answer, but the default ToString on a DateTime omits the milliseconds, so it looks like it isn't when you look at the string representation of the DateTime you create. If you format it with milliseconds, you'll see that you got what you expected.
Thanks. Really appreciate it. My issue is this.
string strDate = "2012-11-09 07:20:07.410"
Datetime actualDate = Convert.ToDateTime(strDate);
Now when I save this date (actualDate) in the database(I am using the Entity Frame work to connect to the database), this is what i see in the database : 2012-11-09 07:20:07.000
As you can see, the millisecond is zero in the database... so my question is how do I save date (after converting from string to datetime) with milliseconds... my datebase date column is SQL datetime type...
In a C# 2010 application, I used linq to sql to setup my database connections.
Now when I move the application to a different database, the original database is still being used. Basically the connection string is hard coded into theapplication.
I tried to follow the linq listed below, but everything did not work.
The part that says, "1.Open up the LINQ to SQL designer, and open the Properties tab of the designer (the schema itself),
expand Connection and set Application Settings to False. ", I did not see this option.
The closest thing I found was connection and I set that value.
Here is the way the code looks now in the *designer.cs file.
publicpartialclass eDataContext : System.Data.Linq.DataContext
privatestatic System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
#region Extensibility Method Definitions
partialvoid Inserte_Detail(e_Detail instance);
partialvoid Updatee_Detail(e_Detail instance);
partialvoid Deletee_Detail(e_Detail instance);
partialvoid InsertIBook(IBook instance);
partialvoid UpdateIBook(IBook instance);
partialvoid DeleteIBook(IBook instance);
partialvoid InsertIPackage(IPackage instance);
partialvoid UpdateIPackage(IPackage instance);
partialvoid DeleteIPackage(IPackage instance);
partialvoid UpdateIError_Tran(IError_Tran instance);
partialvoid DeleteIError_Tran(IError_Tran instance);
partialvoid InsertTransaction_Type(Transaction_Type instance);
partialvoid UpdateTransaction_Type(Transaction_Type instance);
partialvoid DeleteTransaction_Type(Transaction_Type instance);
partialvoid Inserte_Tracking(e_Tracking instance);
partialvoid Updatee_Tracking(e_Tracking instance);
partialvoid Deletee_Tracking(e_Tracking instance);
#endregionpublic eDataContext() :
public eDataContext(string connection) :
public eDataContext(System.Data.IDbConnection connection) :
public eDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
public eDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
Here is what the app.config file looks like right now:
<?xml version="1.0" encoding="utf-8" ?>
</configSections><connectionStrings><addname="e_ClScripts.Properties.Settings.DEVConnectionString"connectionString="Data Source=instance1\DEV;Initial Catalog=dev3;Integrated Security=True"providerName="System.Data.SqlClient"/></connectionStrings></configuration>
Can you tell me or show me in code how to fix my problem so the application does not
use the hard-coded values that were setup by linq to sql?
I don't use Linq to SQL but we have different config files for each environment. The UAT config file will have a different connection string pointing to the UAT server, when you compile for deployment you chose the config you want to use and make sure the config file has the correct connection string.
Never underestimate the power of human stupidity
You are correct that each database has a different connection. However in code, can you show me how to change the connection string and how to change the app.config file to point to the different databases?
The way that linq to sql works is it hard codes the connection string. I want avoid this hardcoded connection string.
Err...That is your connection string. It is in your app.config.
So if you want it to point to a different database then you change that.
If however that is not where your connection string is coming from then it is certainly coming from somewhere so use a text editor to search ALL files you in your source tree for the connection information.