[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Mysql with Linq 2 Entities

Posted on 2010-09-02
3
Medium Priority
?
402 Views
Last Modified: 2012-05-10
I want to recieve all rows from a mysql table and got problems immedietly when adding a "created" field to the model. The created-field is a TIMESTAMP in mysql and appears to be a DateTimeOffset in the model. This give me bug-like-problem when reading the data. How am I possible to cast this field to a string or something?

0
Comment
Question by:dingir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Ashok earned 1500 total points
ID: 33585796
public static string TimestampToString(this System.Data.Linq.Binary binary)  
{
  byte[] binarybytes = binary.ToArray();  
  string result = "";  
  foreach (byte b in binarybytes)  
  {
    result += b.ToString() + "|";  
  }
  result = result.Substring(0, result.Length - 1);
  return result;  
}  

>>>>> There is one more >>>>  public static System.Data.Linq.Binary StringToTimestamp(this string s)

Read complete articel @ http://geekswithblogs.net/AndrewSiemer/archive/2008/02/11/converting-a-system.data.linq.binary-or-timestamp-to-a-string-and-back.aspx

HTH
Ashok
0
 
LVL 1

Author Comment

by:dingir
ID: 33593792
Wow that was a hack..

However i seemed to fix it just by adjust connection string.. i will check it today and leave a  feedback
0
 
LVL 1

Author Closing Comment

by:dingir
ID: 33698785
Not really a solution but maybe it help someone else,
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question