|
Posted
about 15 years
ago
by
[email protected]
(El)
Hi, I'm testing out Linq to MySql. I downloaded the latest MySQL Connector/Net from the MySQL site. I have a simple mysql database with 1 table in the schema. When I executed the command below: sqlmetal /provider:MySql /server:localhost /database:MySqlSampleDb / user:hansel /password:rpt4wr5 /pluralize /code=mysqlsampledb.cs
|
|
Posted
about 15 years
ago
by
[email protected]
(James Darbyshire)
No worries Jon, I will let you know when I have had a look into it. Thanks again, jd Regards, James Darbyshire Sent from my Samsung Droidâ„¢ I won't be working on it any time soon, as I'm swamped with other work. If you decide to hack on it, you can look at src/DbLinq.SqlServer/SqlServer SchemaLoader.cs for a base.
|
|
Posted
about 15 years
ago
by
[email protected]
(Jonathan Pryor)
So this is either a MonoDevelop code completion bug, or some other bug. Thus, the real question is this: does the following compile? If it compiles without error (which I fully expect it to), then the problem isn't sqlmetal/Linq-to-DB/etc., it's MonoDevelop. The fact that this compiles but similarly doesn't show code completion:
|
|
Posted
about 15 years
ago
by
[email protected]
(El)
Hi Jon, I think I fixed the connection string issue. I replaced IDbConnection dbcon = (IDbConnection) new SqliteConnection("Data Source=./MySampleDB.sq3, Version=3"); with IDbConnection dbcon = (IDbConnection) new SqliteConnection("URI=file:./ MySampleDB.sq3, Version=3"); That took care of the problem and it now works. What I don't
|
|
Posted
about 15 years
ago
by
[email protected]
(El)
Hi Jon, Thank you for the analysis. I fixed the code per your suggestion. The schema for this database is quite simple. It contains 1 table called "user" with 2 columns - "uid" of auto increment int and "name" of type text. The output of the generated command was a class that implemented
|
|
Posted
about 15 years
ago
by
[email protected]
(Jonathan Pryor)
I won't be working on it any time soon, as I'm swamped with other work. If you decide to hack on it, you can look at src/DbLinq.SqlServer/SqlServer SchemaLoader.cs for a base. - Jon
|
|
Posted
about 15 years
ago
by
[email protected]
(James Darbyshire)
Thanks Jon. Always helpful! Ok. Well for now it's not too hard to manually change datetime to byte[] in the designer. Are there any plans to use mysql.data.dll to do the type mappings (as suggested on those bug reports) any time soon? If not I may have a hack and submit the code. Regards, James Darbyshire
|
|
Posted
about 15 years
ago
by
[email protected]
(Jonathan Pryor)
My apologies, I apparently misread "timestamp" as "datetime." I need to check my reading comprehension. :-/ Anyway, the reason it's mapped to DateTime is because of src/DbLinq/Vendor/Implementati on/SchemaLoader.TypeMapping.cs SchemaLoader.MapDbType(): case "timestamp": // ...
|
|
Posted
about 15 years
ago
by
[email protected]
(James Darbyshire)
Hi Jon, I found the mapping here --> [link] (same as yours) but it suggests in the graph and in the binary table ( [link]) that timestamp is byte[] or binary. The timestamp I am using is the MySQL timestamp data type, which maps to
|
|
Posted
about 15 years
ago
by
[email protected]
(Paul)
I am using vb.net sqlite.net and dblinq0.20.1 to search a sqlite table on a primary key field. My code looks like this Dim blb = (From d In db.Data Where d.UID = myuid Select d).Single This returns the error "Coalesce used with type that cannot be null" If I search on a nullable field it works fine.
|