[Bug?]Exception Thrown In SSCE 3.5 Beta2 But Not In 3.5 Beta1.
Aug 14, 2007
Hi,
I replace the reference assembly System.Data.SqlServerCe with version 3.5 beta2 in Microsoft.Practices.EnterpriseLibrary.Data.SqlCe. When I used the Data.SqlCe block in application, an exception ("Cannot access a disposed object named SqlCeConnection") threw. This didn't occur in SSCE 3.5 beta1 and early versions.
Finally I found the difference between beta1 and beta2.
In the SqlCeConnection class, there is a RemoveWeakReference method. this is code snippet of beta1:
internal void RemoveWeakReference(object value)
{
if (this.weakReferenceCache != null)
{
this.weakReferenceCache.Remove(value);
}
}
and this is for beta2:
internal void RemoveWeakReference(object value)
{
if (this.weakReferenceCache == null)
{
throw new ObjectDisposedException("SqlCeConnection");
}
this.weakReferenceCache.Remove(value);
}
So, if we dispose a connection before a command, such as:
SqlCeConnection cn;SqlCeCommand cmd;... cn.Dispose();cmd.Dispose(); // Error, an exception will be threw. Is it a bug of Beta2?
View 1 Replies
ADVERTISEMENT
Jan 31, 2007
Hi,
I got an strange problem with one of my packages.
When running the package in VisualStudio it runs properly, but if I let this package run as part of an SQL-Server Agent job, I got the message "The script threw an exception: Exception of type 'System.OutOfMemoryException' was thrown." on my log and the package ends up with an error.
Both times it is exactly the same package on the same server, so I don't know how the debug or even if there is anything I need to debug?
Regards,
Jan
View 2 Replies
View Related
Feb 9, 2006
Getting this error "Exception Has been thrown by the target of an invocation" when trying to create Integration Services Project. Any ideas what can be wrong?
Thanks.
View 3 Replies
View Related
Nov 28, 2006
I have this exception on page loading, is there any solution for this how can I fix this exception...
View 2 Replies
View Related
Sep 7, 2006
Hi,I'm developing a desktop C# app that uses SQL Everywhere as an embedded database. I generated strongly typed DataSet and use that to populate a DataGrid on my app.When the app first loads, it populates the DataGrid with a line like this:
this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);
That all works fine. Later on, after adding more data to the database (through reading a csv file), I wanted to refresh the display on the DataGrid.
I used the same line of code:
this.sTORE_INV_LNTableAdapter.Fill(this.inventoriesDataSet.STORE_INV_LN);
however, this time, the following exception was thrown:
The database file cannot be found. Check the path to the database. [ File name = .\Inventories.sdf ]
Does anyone know what may be going on? I saw this article about a bug in VS 2005 when using strongly typed DataSets (http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.DatabaseCannotBeFoundErrorInTypedDataset)
but that doesn't seem to apply here.
The connection string is identical both times that line of code is called so I'm a bit baffled with what's going on.
Any help would be appreciated. Thanks,
Jose
View 9 Replies
View Related
Mar 3, 2008
All,
I have a large package (I know the recommendation is to have one package per data flow.) It has 20+ data flows in it. Personally I have found it much too complex to manage dozens of packages just because I want to have more than one data flow in my package.
I have been working on this package in an iterative manner over the past several months. Recently, I noticed I started getting the error message: "Exception of type 'System.OutOfMemoryException' was thrown" when I went to save my package. This is _extremely_ frustrating, because when this happens, all the changes I have made are generally lost. Occasionally, I have noticed if I close some other BIDS windows, or just wait a bit, I will be able to click save again, and it will actually save. Usually, I am forced to just "end-task" Visual Studio.
Other than splitting the package up into 20 separate packages, is there a way around this problem? I would rather put up with the lost changes than switch to dealing with 20 separate packages. It just makes things to difficult to manage when everything is split up into so many packages - particularly when I am passing variables around from parent to child packages.
Please help!
Thanks,
David Baldauff
View 13 Replies
View Related
Sep 5, 2007
I have been encountering a problem using a CLR Assembly in SQL server. The Assembly is one provided by Microsoft for an example on using Exchange web services with SQL server.
http://www.microsoft.com/downloads/details.aspx?FamilyId=D6924897-7B62-46FD-874E-24FB0FBA2159&displaylang=en#Requirements
Essentially what this package is, is a set of c# classes that access the Exchange 2007 Web Services via a set of user defined functions and views in MS SQL Server 2005.
We have not modified the code except to configure for our host environment.
We are able to register the assembly using the setup.sql file included. But when we try to access any of the views or use the functions we get the following error:
Msg 10314, Level 16, State 11, Line 10
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65551. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'exchangeudfs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=777b97dde00f3dbe' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
We have 3 testing environments. 2 Windows 2003 servers called test and test2. Also a single Windows 2000 server called test3. Test and test2 have a full suite installed on them, web server, exchange 2007, sql server 2005, they are also domain controllers for their own domains.
We get the above error on test and test2 but it runs fine on test3. Test and test2 represent what our production environment is like. Test3 was just part of our troubleshooting process.
We have tried a lot to make this work. Here are some details on the things we have tried.
The database is set up to allow CLR Assemblies. This is part of the setup.sql.
The assembly's permission is set to external_access.
We have gone all the way to setting the file permissions on the dll to full control to the Everyone group.
We have tried different accounts to run the SQL Service. We've tried the system account, the local admin account and a seperate user account.
The database we are using is a fresh brand new database. Therefore it does not fit into the bug reported in this article:
http://support.microsoft.com/kb/918040
I am really at a loss to where to go from here. Any ideas on why this 'out of the box' solution is causing us so many headaches would be appriciated.
Thanks,
Tim
View 4 Replies
View Related
Oct 24, 2007
I just opened a large table with about 800 columns and 300,000 rows.
Doing the right click open on table displays message: Exception has been thrown by the target of an invocation.
Please help me determin what the error is and how to solve it.
I have google it for days now and no one has similar situation as mine. Many have same error, but their fix is not relevant to my issue. If you know about some SQL query limit please let me know.
Funny thing is that if I right click table and do script ---> select, then it does pull the data. ONly doesn't work when I do "Open Table."
Thanks for your help.
View 1 Replies
View Related
Oct 7, 2015
I have a custom SSIS Script task (c# code) which , using WINSCP secure FTP libraries, downloads files from an FTP server to local folder.This works perfectly fine on my personal machine.But when I deploy the project on to Catalog, and try and run the same SSIS package using Agent Service , I get this error - "Exception has been thrown by the target of an invocation."
The Service account used to run the package (on the server) has all the needed permissions to write into the folder on the server.
View 5 Replies
View Related
Mar 17, 2008
I starting getting the error above today when attempting to deploy updated DSV's and Report models. I can't seem to locate any info about this error - seems like a generic one. We're on 2005 SP1 (think we're on build 2221). Any help is appreciated!
View 5 Replies
View Related
Sep 1, 2015
've got an execute task that take data from a simple table ,I set up the variable Passing as object and I pass the variable to a For Each loop container..
I call the variable in the for each loop container and using the script VB I try to msgbox the variable but it gives me the error:
exception has been thrown by the target of an invocation.
What's wrong?
View 4 Replies
View Related
Apr 2, 2008
Help,
I get the following exception anytime I attempt to open a .dtsx file in the SSIS project in VS2005:
"External component has thrown an exception. (System.Windows.Forms)"
I haven't made any changes to this project and it was up and running fine a week or so ago. Any ideas? Help.
Thanks - Wayde
View 5 Replies
View Related
Nov 19, 2013
I have a SSIS package with Script task ,it performs basic operation of moving files to one location to another .It works fine in VS2012 environment and when i write a SQL job to execute the package ,it fails ,below is the error :
Code: 0x00000001 Source: Script Task_MoveOldFilestoArchive
Description: Exception has been thrown by the target of an invocation. End Error
DTExec: The package execution returned
DTSER_FAILURE (1). Started: 9:54:57 AM Finished: 9:54:58 AM Elapsed: 1.029 seconds. The package execution failed. The step failed.
View 4 Replies
View Related
Sep 5, 2006
Hi,
Sharepoint Search doesn't return any Results. Eventlog Shows:
Event Type: Error
Event Source: Office Server Search
Event Category: Gatherer
Event ID: 10027
Date: 05.09.2006
Time: 13:42:14
User: N/A
Computer: SAxxxxx
Description:
Failed to update committed transaction in SQL, DocID is 23647.
Context: Application 'SSP_CORE', Catalog 'Portal_Content'
Details:
Value violated the integrity constraints for a column or table. (0x80040e2f)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Does anyone know about this Problem?
View 4 Replies
View Related
Nov 12, 2005
I've not been able to test this yet in full VS2005 (MS is screwed up with orders for some reason. Has anyone heard this one. All orders for less than quantity=5 were being rejected). So, instead of waiting for it I installed VWD Express. Now, the project had been built in VWD express beta 2, so no big change there.Several gridview controls in the project had <Delete> enabled. Just <Delete> mind you. Nothing else for command buttons. They all worked fine with delete queries that use gridview.selectedvalue as the parameter. Every single one stopped working since I've converted from beta 2 to RTM!Here's what I determined. The delete will only work if the row in the grid is selected first!. Otherwise <selectedvalue> is null when you click on <Delete>.Is this a bug or what?I'd be happy to supply more details. I am certain others will report this, but I have yet to find a post here or in any blogs out there that reproduce this problem in the RTM of .NET 2.0
View 2 Replies
View Related
Sep 13, 2007
Hello,
I have installed VS 2008 Beta 2 which includes SQL CE 3.5, (I have VS 2005 installed too).
I can not get any INSERT command to work!
First i have tried the VS wizard for a new connection and a dataset. but after inserting a row into one of the dataset tables and then updating it to SQL CE with tha data adapter, nothing happens! NO ERROR and NO inserted row in the database file! so the identity of the inserted row in dataset table doesnt get updated.
Then i tried a simple code without any dataset in a clean solution:
Code Snippet
Dim con As New SqlCeConnection("Data Source=|DataDirectory|MyDatabase#1.sdf")
Dim cmd As New SqlCeCommand("INSERT INTO [Table1](Name) VALUES('TestValue')", con)
Try
con.Open()
cmd.ExecuteNonQuery()
Catch ex As SqlCeException
MessageBox.Show(ex.Message)
Finally
con.Close()
End Try
NO ERROR! NO INSERTED ROW! Nothing happen!
I'm using it in a desktop application.
Why?
Regards,
Parham.
View 5 Replies
View Related
Jan 16, 2008
Greetings everyone, I am attempting to build my first application using Microsofts Sql databases. It is a Windows Mobile application so I am using Sql Server Compact 3.5 with Visual Studio 2008 Beta 2. When I try and insert a new row into one of my tables, the app throws the error message shown in the title of this topic.
'((System.Exception)($exception)).Message' threw an exception of type 'System.NotSupportedException'
My table has 4 columns (i have since changed my FavoriteAccount datatype from bit to Integer)
http://i85.photobucket.com/albums/k71/Scionwest/table.jpg
Account type will either be "Checking" or "Savings" when a new row is added, the user will select what they want from a combo box.
Next is a snap shot of my startup form.
http://i85.photobucket.com/albums/k71/Scionwest/form.jpg
Where it says "Favorite Account: None" in the top panel, I am using a link label. When a user clicks "None" it will go to a account creation wizard, and set the first account as it's primary/favorite. As more accounts are added the user can select which will be his/her primary/favorite. For now I am just creating a sample account when the label is clicked in an attempt to get something working. Below is the code used.
private void lnkFavoriteAccount_Click(object sender, EventArgs e)
{
FinancesDataSet.BankAccountRow account = this.financesDataSet.BankAccount.NewBankAccountRow();
account.Name = "MyBank Checking Account";
account.AccountType = "Checking";
account.Balance = Convert.ToDecimal("15.03");
account.FavoriteAccount = 1;//datatype is an integer, I have changed it since I took the screenshot.
financesDataSet.BankAccount.Rows.Add(account);
//The next three lines where added while I was trying to get this to work.
//I don't know if I really need them or not, I receive the error regardless if these are here or not.
this.bankAccountTableAdapter1.Update(financesDataSet);
this.financesDataSet.AcceptChanges();
refreshDatabase();
}
the refreshDatabase() code is here:
private void refreshDatabase()
{
this.bankAccountTableAdapter1.Fill(this.financesDataSet.BankAccount);
//Aquire a count of accounts the user has
int numAccounts = financesDataSet.BankAccount.Count;
//Loop through each account and see which one is the primary.
for (int num = 0; num != numAccounts; num++)
{
//Works ok in frmMain_Load, but when my lnkFavoriteAccount_click calls this, it throws the error.
if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)
{
//Display the primary account on our home page. User can click the link label & be taken to their account register.
this.lnkFavoriteAccount.Text = this.financesDataSet.BankAccount[num].Name.ToString();
this.lnkFavoriteFunds.Text = this.financesDataSet.BankAccount[num].Balance.ToString();
break;
}
}
}
and my form_load code
private void frmMain_Load(object sender, EventArgs e)
{
refreshDatabase();
}
So, when I click on the lnkFavoriteAccount label, and my new row gets added, the app stops at the following line in my DataSet.Designer
[global:ystem.Diagnostics.DebuggerNonUserCodeAttribute()]
public byte FavoriteAccount {
get {
try {
return ((byte)(this[this.tableBankAccount.FavoriteAccountColumn]));
}
catch (global:ystem.InvalidCastException e) {
//Stops at the following line, this error was caused by 'if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)'
throw new global:ystem.Data.StrongTypingException("The value for column 'FavoriteAccount' in table 'BankAccount' is DBNull.", e);
}
}
set {
this[this.tableBankAccount.FavoriteAccountColumn] = value;
}
}
I have no idea what I am doing wrong, all of the code I used I retreived from Microsofts help documentation included with VS2008. I have tried used my TableAdapter.Insert() method and it still failed when it got to
if (this.financesDataSet.BankAccount[num].FavoriteAccount == 1)
in my refreshDatabase() method it still failed.
When I look, the data has been added into the database, it's just when I try to retreive it now, it bails on me. Am I retreiving the information wrong?
Thanks for any help you guys can offer.
Johnathon
View 1 Replies
View Related
Apr 10, 2006
Hi guys
i am puzzled on how to decipher the below msg on my sql server
Had tried adjusting the settings but apparantly doesnt work
is this due to my license or what other reasons?
Error msg:
17052 :
This SQL Server has been optimized for 8 concurrent queries. This limit has been exceeded by 30 queries and performance may be adversely affected.
sql server : MS SQL Enterprise 8.0
View 1 Replies
View Related
Sep 11, 2007
I have a VB.NET project that I'm developing for Windows Mobile 5 and 6. When I go to do an update using a data adapter in SQL CE, I get this error message:
SqlCeException was unhandled
[ Quality,UQ__Quality_0000000000000161 ]
As you can see, the error message above is far from being user friendly (thanks MS.) Any ideas anyone?
NOTE: Quality is the name of the table I'm accessing.
View 1 Replies
View Related
Oct 10, 2006
Hi,
Our application has two parts: one is Windows application and the other
one is Windows service. The service runs under Local system accont. We
use third party application to log into database which uses instance of
SQL Server 2005 Express . We use same methods for logging for Windows
application and for Windows service. Both, application and the service
are compiled with .Net framework 2.0 and VS 2005 (C#).
The application always logs into the database succesfuly. The problem
is with the service. The code for the service works like this: first
login into database to retrieve some data, after that log off and
disconnect, and after that immediately tries to login again using the
the same credentials. The first login is always succesful, but the
second one fails with error message:
Type:System.ArgumentNullException
Message:Value cannot be null.
Parameter name: Value is
null.
If we set the Service to run under User windows
account - everything works fine. Does anyone have similar
problems? What can be the problem here? Can anyone help me?
Thanks.
View 5 Replies
View Related
May 28, 2004
Hello:
I have a database table where a primary key is defined. When I enter data that is the same as another table, it does not allow and throws an error which I do want. What happens is that a Server Error in Application error type is thrown with the following message:
Violation of PRIMARY KEY constraint 'PK_cs_sc'. Cannot insert duplicate key in object 'cs_sc'. The statement has been terminated.
How can I detect the error in my own asp.net page code so that it does not forward my users to the asp.net server error page? Heres my code below... how can I check for success or failure within this code?
Dim conSqlConnect As SqlConnection
Dim strInsert As String
Dim cmdInsert As Sqlcommand
conSqlConnect = New SqlConnection( "Server=localhost;uid=var;pwd=var;database=var" )
strInsert = "Insert cs_sc ( [name] ) Values ( @name )"
cmdInsert = New SqlCommand ( strInsert, conSqlConnect )
conSqlConnect.Open()
cmdInsert.ExecuteNonQuery()
conSqlConnect.Close()
View 3 Replies
View Related
Nov 22, 2007
I am using the following code to check whether a message exists on the specified queue:
Code Block
DECLARE @RecvReplyMsg NVARCHAR(100);
DECLARE @RecvReplyDlgHandle UNIQUEIDENTIFIER;
BEGIN TRANSACTION;
RECEIVE TOP(1)
@RecvReplyDlgHandle = conversation_handle,
@RecvReplyMsg = message_body
FROM TargetQueue;
END CONVERSATION @RecvReplyDlgHandle;
SELECT @RecvReplyMsg AS ReceivedReplyMsg;
COMMIT TRANSACTION;
GO
How can I prevent errors being thrown when there are no messages waiting on the queue? For example, if I send a message to the queue and run the above twice I get the following:
Msg 8418, Level 16, State 1, Line 11
The conversation handle is missing. Specify a conversation handle.
Thanks
View 3 Replies
View Related
Apr 4, 2007
Hi
Does anyone have an example code in C++ to create a SSCE db and access data?
Many thanks
Ozzie
View 3 Replies
View Related
May 17, 2007
Hello All,
I have a package in which I have enabled "Package Configuration".
When I run the package i am sure that it reads the configuration file and executes the package correctly.
However if I remove the configuration file, the package still executes correctly with the settings which were used at the time of development.
I have event handlers for OnError and OnWarning and both these are NOT invoked.
IMO, this is incorrect behavior because if a package has been configured for "package configuration, then we should atleast have a warning generated that SSIS did not find the configuration and it would execute the package with hard coded values (from the time of development).
Is there any work around for this? how can I make SSIS warn me if the config file is missing for a package which was configured for package configuration?
View 5 Replies
View Related
Jul 31, 2007
hi,
this is my first post here, i am using Sql Server CE 2005 these days.
in a project i found 2 problem that can't find any solution for them till now , maybe there are some bugs i founded them
here is :
1- when i have a SqlCeCommand Object and the ComandText for it is "Update [Term] SET Year=? WHERE _id=? AND name=? "
the problem is in here , i added parameters for this command, if value of parameter is in Unicode ( i tested it in Farsi[Persian] language value like 'زمستان' on 'name' parameter) , in ExcuteNonQuery() method , it throws FormatException with "Input String was not a correct format".
although if i change the value of 'name' parameter to something non-unicode (for example i tested it with 'ABCDE' ) it works correctly,
i think SqlCeCommand in UPDATE query , have problem with unicode values in paramteres.
2- second one is so strange for me !! , i have a loop that update a column in a table. and then have another loop that update the next column of that table. for example first i update the column 3 in loop, then in another loop i update the column 4.
after all, the value of column 4 and 3 is substituted, it means that values that i updated for column 3 is in column 4 , and values that i updated for column 4 is in column 3 !!!!!!!
both columns is in 'int' type.
and the last point is i tested both of this situations in SQL Server 2000 Developer Edition and both worked correctly without any problem.
also i used SQL Server CE v3.1 with .Net framework 2.0 in Vs2005 and C#.
is there any missing i'v done or is it some kind of bugs.
View 4 Replies
View Related
May 16, 2007
We are looking into developing our application using SQL Server Compact and have created a test database to become familiar with the API. Having read about ACID transactions in SSCE we would like to know how this is actually employed. What will happen if a power failure occurs during a transaction? Does this have to be recovered in the code?
I have read the following article: http://msdn2.microsoft.com/en-us/library/csz1c3h7.aspx, but is this the best way to deal with transaction failures?
I can't find any examples on how to recover from failures in transactions in SSCE.
Any help would be greatly appreciated.
View 4 Replies
View Related
Jun 11, 2007
Hi,
Are there any pecularities of Transaction Logs in SSCE comparing to the same log in full scale SQL Server? How are they stored? And when they are considered to be expired in order to safely delete them?
Thanx in advance
View 6 Replies
View Related
May 18, 2007
i'm use this code ,in SQL2005 std and ACCESS database, it work
but if i use SSCE ,it's throw a OleDbException in ExecuteScalar()
Exception : OleDbException
0x80040E30L
DB_E_BADTYPENAME
Code Snippet
OleDbConnection od = new OleDbConnection("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source=db.sdf;SSCE:Database Password=");
od.Open();
OleDbCommand og = new OleDbCommand("INSERT INTO [bills] ([billno],[checkouttime],[finalprice],[handle],[ischeckout],[memo],[paymode],[trick]) VALUES (@billno,@checkouttime,@finalprice,@handle,@ischeckout,@memo,@paymode,@trick)", od);
og.Parameters.Add("@billno", OleDbType.VarWChar).Value = "2007051800000000";
og.Parameters.Add("@checkouttime",OleDbType.DBTimeStamp).Value="2007-5-18 11:55:40";
og.Parameters.Add("@finalprice", OleDbType.Single).Value = 0.0;
og.Parameters.Add("@handle", OleDbType.VarWChar).Value = "admin";
og.Parameters.Add("@ischeckout", OleDbType.SmallInt).Value = 0;
og.Parameters.Add("@memo", OleDbType.VarWChar).Value = "";
og.Parameters.Add("@paymode", OleDbType.VarWChar).Value = "";
og.Parameters.Add("@trick", OleDbType.VarWChar).Value = "";
og.ExecuteScalar();
od.Close();
why the same code is not work? i'm find all MSDN ,but there is no answer
Who can help me,Thanks
View 7 Replies
View Related
Nov 17, 2007
Hi-
VS 2008 supports targeting different versions of the .NET Framework. Will this apply to SSCE as well? I have some older apps that I want to keep in .NET 2 and SSCE 3.1. But I would also like to develop new stuff in 3.5. Will the targeting mechanism in VS 2008 support using SSCE 3.1 with .NET 2.0 and SSCE 3.5 with .NET 3.5?
Thanks.
-Gary
View 3 Replies
View Related
Aug 5, 2007
I have been having "fun" trying to get all the bits (SSCE 3.5, Orcas Beta 2, SQL Managment Studio) in Vista 64 and Xp 32.
So far I have found at the SQLMetal does work with SSCE 3.5 but not in Vista64
BUT I cannot get any tool (tried SQL and SLQ express) to manage my SSCE db - ie make relationshipos so that SQLMatal can do its stuff
Any advice as to which tool to use to manage SSCE 3.5
Thanks
Mike
View 5 Replies
View Related
Nov 22, 2007
Does anybody have the RTM build numbers for SQL Server Compact Edition 3.5?
Thanks
View 5 Replies
View Related
Sep 20, 2007
Could y'all please clarify this statement with some examples:
"A SQL Server Client Access License (CAL) is required for any connection to SQL Server, including a connection from SQL Server Compact Edition."
Is this only referring to RDA, or is it referring to data replication by any means? Is there any restrictions for connections between SSCE devices?
Thanks!
View 3 Replies
View Related
Apr 2, 2008
I've just recently downloaded Visual Studio 2008 Express which comes with SQL Server 2005 Express and SQL Server Compact 3.5, both of which were installed when I installed the products.
I've been following the tutorial videos and trying some stuff of my own and I just can't seem to get a Compact 3.5 database to actually update! I'm doing EXACTLY what is shown in the tutorials and th dataset is being updated - changes and added records - and they will show up in a DataGrid control as expected, but when I accept the changes - nothing is changed and/or added to the actual .sdf file. When I open it again, it's the same as it was before. Using exactly the same code but with an SQL Server 2005 Express database (.mdf), updates are fine.
First I created a dataset that connects to the SSCE 3.5 database .SDF file. Then I simply drag the table from the dataset to the form which creates Dataset, Table Binding Source, Table Adapter Manager and BindingNavigator items, in addition to the toolbar and DataGrid controls. The code generated from this is below. I have added the Try/Catch block and messages to see if any errors are ocurring.
Code Snippet
Public Class Form3
Private Sub TblMessageTypeBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TblMessageTypeBindingNavigatorSaveItem.Click
Me.Validate()
Me.TblMessageTypeBindingSource.EndEdit()
Try
Me.TableAdapterManager.UpdateAll(Me.AppMessagesDataSet)
MsgBox("Changes Saved")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'AppMessagesDataSet.tblMessageType' table. You can move, or remove it, as needed.
Me.TblMessageTypeTableAdapter.Fill(Me.AppMessagesDataSet.tblMessageType)
End Sub
End Class
When I run the app, the data in the database table is displayed correctly. If I make a change and add a record then click the Save button, I get the expected "Changes Saved" message indicating that there are no errors. When I look a the contents of the table, the changes and additions did not happen and the data is exactly the way it was before.
I had the full SQL Serer 7.0 installed as well so I thought there might be a conflict or something became corrupted. In uninstalled SQL Server 7.0, SQL Server 2005 Express and SQL Server Compact 3.5. I "repaired" VB 2008 Express which reinstalled SQL Server Compact 3.5 and separately reinstalled SQL Server 2005 Express. Same problem.
As I mentioned above, what gets me is that if I use the same setup for a SQL Server 2005 Express database, changes and inserts work just fine. (Used the Northwind.mdf (Express) and the Northwind.sdf (Compact) sample databases and created my own sample .mdf and .sdf databases - same results.)
I've looked at whatever I can to see if I can find the problem but just can't put my finger on it. Very frustrating.
Does anyone have any advice on what I might be doing wrong with Compact or if there is something I've missed or if there's a property somewhere that needs to be set, or perhaps a configuration issue??
Many thanks,
Ben
View 6 Replies
View Related