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

SQL Compact - ISSUE: Not saving data

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

HI

I have developed a simple app in vs2010 (vb) that save some data to a table.

I know I have the correct file because in the server explorer (design time) I have manually added a few rows of data to the db. 

When I run the app, sure enough the data I wrote to the db in deisgn mode is there at run time and I can add and review more data at runtime.

 

HOWEVER even though the data is there at run time, is is not saved to the db.sdf file because when I view the contents of the table i nthe designer again, only the data that I manually added is there.

 

So why is it not saving run time data?

 

I have tried to wait the 10seconds, and to force 1 secong in the connection string, all to no avail.

Is this a bug? How do I flush the runtime data to disk?

 

Thank you in advance,

Gareth


View Complete Post


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

Grouping Data in the ListView Control

  
In ASP.NET 1.X and ASP.NET 2.0 DataList was the primary control used to display data in groups. In ASP.NET 3.5 we have a new control that takes care of grouping data. In this article we are going to demonstrate how to group data using the ListView control.

Selecting and Highlighting Multiple Columns in a Data Grid

  
Many times you want to select multiple columns in a DataGrid and highlight the columns selected.

In the DataGrid MouseDown Event you will find out if you have selected a column header through the hit test. You then find the co-ordinate of the column and construct a rectangle out of that. If you are selecting multiple columns you can store the index of the columns and the rectangle in ArrayList.

Make sure you clear the ArrayList when you HitType is None.

How to keep rigth data in cache

  

Hi,

I would want to know what is better: to keep a lot of data in cache at once or to keep a little data by paging?

 

For example:

I have 1000 articles and 200 pages.


send alert message to user if close internet browser before save web form data

  

 Hi, I have window form to let user fill data, I want to alert user if close web browser before saved web form data, could anyone provide any clue?

 

Thanks,

Martin


How to display dynamic XML data inside a Panel control?

  

Hi all,

I have a SQL routine which builds me an entire XML file and returns it as a string. 
If I save the content of this file as sample.xml for instance, I am able to open it in IE or any other browser and the user can expand the nodes and see all the content he wishes.

I am trying to build a ASP.Net page which will display the content of a XML file in the same way (or similar) that the browsers do.

So far, I've been reading some posts and noticed I can use XmlDataSource control and its Data property to load the entire XML doc as a string. Now I am stuck how to display the contents. I found TreeView very confusing and not sure if DataGrid would be a alternative as well. I need to user to be able to open and expand the nodes.

Please someone point me to the right direction. What controls to use, etc... sample codes are the best ;-)

Thank you

 


Multiple validator issue

  

A CompareValidator to check the textbox for date type and a RangeValidation the check the date range is applied to a textbox. But if user enters incorrect date format, both validators are triggered. Is there any way to set the trigger sequence so that only one validator fires in this scenaio?

Thanks.

 


grid view without any data source date sorting problem

  

i grid view contain the following coloum

id    name         DateofBirth                  DateofJoining 

1       a            22-Aug-1980                      10-jan-2000

1       a            22-may-1980                      20-feb-2000

1       a            12-Feb-1980                      15-mar-2000

1       a            3-Aug-1980                      7-jan-2000

how to sort if we click   DateofBirth or Dateofjoining and not sort any where if we click(Id,Name)


Need help: Issue with Dynamic Checkboxes CheckChanged Events

  

Hello All, I have almost broken my head on this whole day today, looks like i am not getting something and thats why its not working. Someone please help.

Below is the scenario:
In the aspx page, i am dynamically adding a checkbox to an htmltable.  To its CheckChanged event, i am adding one more row in the table and adding another checkbox. I am not able to get this new checkbox's CheckChanged event. I understand that its not getting created, but i am not sure how do i handle it.
Below is the code, can someone help me correct this code and help me on how do i achieve it.

Note: I have to use the HtmlTable.Rows.Insert method only, to add the new row with its controls to the HtmlTable based on indexes.

ASPX PAGE

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>        
        <table id="tblGenerator" runat="server"></table>
    </div>
    </form>
</body>
</html>
ASPX.CS PAGE - CODE BEHIND

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebApplication1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            tblGenerator.Style.Add("border", "1");
            tblGenerator.EnableViewState = true;
            HtmlTableRow tblRow = new HtmlTableRow();

            HtmlTableCell tblCellLeft = new HtmlTableCell();
            HtmlTableCell tblCellRight = new HtmlTableCell();

            Label lblOne = new Label();
            lblOne.ID = "lblOne_1";
            lblOne.Text = "This is for checkbox 1";
            tblCellLeft.Controls.Add(lblOne);

            CheckBox chkBoxOne = new CheckBox();
            chkBoxOne.ID = "chkOne_1";
            chkBoxOne.AutoPostBack = true;
            chkBoxOne.EnableViewState = true;
            chkBoxOne.CheckedChanged +=new EventHandler(chkBoxOne_CheckedChanged);
            tblCellRight.Controls.Add(chkBoxOne);

            tblRow.Cells.Add(tblCellLeft);
            tblRow.Cells.Add(tblCellRight);

            tblGenerator.Rows.Add(tblRow);            
        }

        void  chkBoxOne_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox chkBox = (CheckBox)sender;

            HtmlTableRow parentRow = (HtmlTableRow)chkBox.Parent.Parent;
            HtmlTable parentTable = (HtmlTable)chkBox.Parent.Parent.Parent;

            int index = parentTable.Controls.IndexOf(parentRow);

            HtmlTableRow newRow = new HtmlTableRow();
            HtmlTableCell childTblCellLeft = new HtmlTableCell();
            HtmlTableCell childTblCellRight = new HtmlTableCell();

            Label childLblOne = new Label();
            childLblOne.ID = "childLblOne_1";
            childLblOne.Text = "This is for child checkbox";
            childTblCellLeft.Controls.Add(childLblOne);

            CheckBox childChkBoxOne = new CheckBox();
            childChkBoxOne.ID = "childChkOne_1";
            childChkBoxOne.AutoPostBack = true;
            childChkBoxOne.EnableViewState = true;
            childChkBoxOne.CheckedChanged += new EventHandler(childChkBoxOne_CheckedChanged);
            childTblCellRight.Controls.Add(childChkBoxOne);

            newRow.Cells.Add(childTblCellLeft);
            newRow.Cells.Add(childTblCellRight);

            //add 1 to the parent table's row index to insert new row to the parent table ...            
            parentTable.Rows.Insert(index + 1, newRow);            
        }

        void childChkBoxOne_CheckedChanged(object sender, EventArgs e)
        {
            Response.Write("Child checkbox changed");
        }
    }
}



 


display data in row and column both

  

i have created university timetable.

how to display data.??

days show in row wise and period showin column wise

aur every period have particular course..

gridview..detalview or any thing..??

plz reply urgent....

give complete steps

 


Selected value for filtered data in ListView

  

My page has ListView with SqlDataSource. I set SqlDataSource as DataSet and EnableCaching = True.

BEFORE I filter SqlDataSource, I don't have problem to get the record value for selected record data in my ListView.

AFTER I filter SqlDataSource, my ListView can display the filter record data properly, but I have problem to get the record value for selected record data in my ListView. The record value for selected record data does not refer to the record value what I am selecting.

Please advise this problem. SqlDataSource must be set as DataSet and EnableCaching = True for solving this problem.

Thanks.


 
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