Question: I am using Zotero as a plugin in Firefox on a Ubuntu12.4 machine.

Since last week, the BibTex format for export seems to have disappeared from the options in the preferences. I have absolutely no idea why and I don't really care why. I simply want to get it back since it worked before.
So I am looking for explanation on how to reinstall this option and eventually on where to get the format.
I tried to desactivate and reactivate the zotero plug-in but it did not work.

Thanks for any help

Answer: 
Use a parameterized query and set the parameter type to [`Datetime`](https://msdn.microsoft.com/en-us/library/system.data.sqldbtype(v=vs.110).aspx):

```
SqlCommand cmd = new SqlCommand(
      "INSERT INTO ... (..., datetimecolumn, ...) VALUES (..,@datetimeparameter,...", 
       connection);
SqlParameter datetimeParameter = new SqlParameter(
      "@datetimeparameter", 
       SqlDbType.Datetime);
datetimeParameter.Value = <your C# variable of type Date>;
...
cmd.ExecuteNonQuery();

```

Using a framework like Entity Framework would take care of a lot of the boilerplate coding.

Using [`SqlBulkCopy`](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy(v=vs.110).aspx) is another viable approach.

What does **not** work is passing in values as hard coded strings in T-SQL. Aside from SQL injection prone, slow and unperformant, there are countless issues around the combination of client (app) locale, server locale and SQL Server locale settings ([`SET DATEFORMAT`](https://msdn.microsoft.com/en-us/library/ms189491.aspx)). For the record: there is a locale independent datetime format in SQL Server, namely the `YYYYMMDD hh:mm:ss` format. Whenever you *must* use a T-SQL string to represent a date, use this format as is locale agnostic.

Also you might want to learn a bit about [SSIS](https://msdn.microsoft.com/en-us/library/ms141026.aspx) as it does what you're trying to achieve out-of-the-box (there is an [SSIS Excel source](https://msdn.microsoft.com/en-us/library/ms141683.aspx)).
Excel stores internally the datetime as a number. So you will probably have to read it as number as well and convert it "manually" before storing it in SQL