Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

Copying .sdf file in Windows 7 causes corruption

Posted: Jan/22/2011   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:122   Vote Up (0)   Vote Down (0)    

I have an application created for Win CE 5.0 using SQL CE 3.0.

Since my desktop application cannot access the db directly on the mobile device, it will copy the db to a temp file , make whatever changes, and copy back to the mobile. This has worked fine with Windows XP and Active Sync.

On Windows 7, if I copy the file from the desktop to the mobile device using Explorer, the .sdf file becomes corrupt. The mobile application cannot open it as it complains of a missing table. If I use SQL Analyser on the mobile device, I can connect to the db and open it. The table list appears but no columns or indices are displayed and if I run a query "SELECT * FROM table1" it errors with table not found. If I close SQL Analyzer, then compact the db before opening it, everything is good again, I can run queries against the table and the view shows me all the columns.

Does anyone have any idea as to where to start looking?

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Writing in Web.config file programatically in asp.net 1.1, 2.0

  
Web.config allows the developers to change the configuration of the application without having to build the application. Its not a good idea to write to the configuration file dynamically as it will restart the application. But sometimes we need the feature to dynamically write to the config file. This can be the case when you allow the users to personalize the connection string. In this article we will see how we can dynamically write the connection string to the Web.config file.

ASP.NET Windows Authentication, Domains and Roles

  
We are using windows authentication for a web application and have the roles defined in the web.config for each page.
The problem is that we have to have them in the form DOMAIN\RoleName which means when we deploy it to a different domain we have to do a search and replace.
So is there either:

how to open a database in a webmatrix C# file?

  

In the webMatrix examples, which I have working, it's very easy to access a database. Only three lines are necessary to get up and going:

@{ 
    var db = Database.Open("LOS");  
    var selectQueryString = "SELECT * FROM wknTest"; 
} 

and a little later,

 @foreach(var row in db.Query(selectQueryString)){  

There's no using's, no connection strings, all that happens behind the scenes. But now I have enough complicated c# code that I want to separate it into a separate C# file. How would I do the above, but in a C# file residing in the app_code folder in a webMatrix project? 

WebMatrix must be creating the Database object behind the scenes.  So I'm really asking how do I have access to that.


Unable to connect. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Check Web.config file "ConnectionString" setting.

  

Hi,

I am getting this error:

Unable to connect.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Check Web.config file "ConnectionString" setting.


anybody knows the solution?


thanks in advance.




Where is .dbo file stored?

  

Hi Everyone,

This is quite bewildering and can't believe I'm asking this.

I'm looking for the .dbo database file to back up and later publish online to make the project live but cannot find it!

I've done the countless Windows search (Windows 7), searched every folder in my project and every folder in Visual Studio 2008. Im using SQL Express edition (2008).

In VS08: I can goto 'Publish to provider' and it cannot find the file, the Properties of the DB state the 'Provider' is .NET Framework.

I was under the impression is always saved it in App_Data thus its not in that directory. Is there somewhere it automatically stores the Database/.dbo file? Also, it wouldnt be a hidden file surely?

Yet when i click to access it, I can do everything, from querying data to adding tables, SP, etc - Also, is there any script that can generate the code for the database? so i could just run that thus recreating what I've already got? I've done it in Oracle briefly in one instance during my studies - but that was all automated.

I know I'm being rather vague will my detail, any info needed i'll do my best to provide.

Many Thanks!

Dan


large text file to xml.

  

hi ,


can any one guide me.

i have a large text file  has about 60000 records delimited by spaces. i have to provide  search criteria on that file on multiple columns

i thought to convert to xml  then to database and then search criteria from there.bcz data is already in textfile.

 i found some code to conver to xml.

protected void ConvertTextToXml(char delimiter,string tfile, string xmlfile)
    {
        DataSet xmldataset = new DataSet();
        DataTable xmltable = new DataTable();
        DataRow xmlrow ;
        using (StreamReader reader=new  StreamReader(tfile))
        {
            
            //adding headers
            reader.BaseStream.Seek(0, SeekOrigin.Begin);
            foreach (string field in reader.ReadLine().Split(delimiter))
            {
                xmltable.Columns.Add(field);
            }

            //add rows to table
            while (reader.Peek() != -1)
            {
                xmlrow = xmltable.NewRow();
                foreach (string field in reader.ReadLine().Split(delimiter))
                {
                    xmltable.Rows.Add(field);
                }
                xmltable.Rows.Add(xmlrow);
            }

            xmldataset.Tables.Add(xmltable);
            xmldataset.WriteXml(xmlfile);
        }

    }

its creating xml file but iam unable to read /open that. is there any efficient way to handle large files using xmldatasource.


how to read a folder contain 10 xml file in All are grid view file contain....

  

a folder contain

1.xml,2.xml,3.xml,4.xml.........................10.xml  how to read all file contain in Grid view the containt is

<Data>
  <Data>
    <Leave_Application>
      <To_The>
        <Date>2010-11-16</Date>
      </To_The>
      <Name>
        <Name_of_Employee>Ravindra Sharma</Name_of_Employee>

        <Mobile>09711088834</Mobile>
        <Email>sharma.ravi577@gmail.com</Email>
      </Name>
      <Designation_Departments>
        <Designation_Department>Data_Operator</Designation_Department>
      </Designation_Departments>
      <Leave>

        <Leave_Requird>2</Leave_Requird>
        <From>2010-11-17</From>
        <To>2010-11-19</To>
      </Leave>
      <Total_Days>
        <Total_Day>2</Total_Day>
      </Total_Days>

    </Leave_Application>
    <Leave_Details>
      <Leave_Records>
        <Leave_Record>
          <Type>CL</Type>
          <Can_Aval>2</Can_Aval>
          <Availed>1</Availed>

          <Balances>8</Balances>
        </Leave_Record>
        <Leave_Record>
          <Type>SL</Type>
          <Can_Aval>7</Can_Aval>
          <Availed>5</Availed>
          <Balances>3</Balances>

        </Leave_Record>
        <Leave_Record>
          <Type>EL</Type>
          <Can_Aval>5</Can_Aval>
          <Availed>2</Availed>
          <Balances>3</Balances>
        </Leave_Record>

      </Leave_Records>
      <Reason>
        <Reason_For_Leave>Due to some personal reason</Reason_For_Leave>
      </Reason>
      <Signatures>
        <Signature_of_Employee>Ravindra Sharma</Signature_of_Employee>
        <Date>2010-11-16</Date>

      </Signatures>
      <Add_Remarks>
        <Remark>asdf ;lkjh asdf ;lkj asdf ;lkj asdf ;kj asdf ;lkj asdf ;lkj</Remark>
      </Add_Remarks>
    </Leave_Details>
  </Data>
</Data>


 


Save file into database through asp.net controls

  

I want to save a file (e.g. .xls, .pdf, .doc) into MySql database through ASP.net web interface, and then to download this file.  i have fields WONO,PONO,Des on my webform i am supposed to have another filed upload excel file from button.it should save as usaul like rest of the fields into databases and retreive same on to web form when required and open the same excel sheet.I really thankful if any one provide me the code.


Session: Database vs File IO (xml)

  

In a case where I'd like to store a session on disk, what is the recommended means: through a database or simple a file (I'm thinking of use xml)?

I know that hardware impacts on the reliability and performance.  Can someone explain which hardware is good for this situation, in terms of reliability and speed and performance?


 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge