SQL Express Not Updating Database
Apr 3, 2006
I recently converted a program I made in C# from Access to Sql Server Express and I noticed something odd.
Anytime I update or insert data into the database, it only sticks around until the program closes. I can insert new records but as soon as the program quits, the inserts are gone.
Is this a bug or is there something else I need to do?
View 7 Replies
ADVERTISEMENT
Aug 18, 2007
I am having trouble updating my database. I have seen a couple of other people had the same problem. Two answers I had found and tried did not work. The updating if newer I had already came across in a step by step class room tutorial written by a college professor and to make sure the save procedure came after the update procedure. I did need to make this last change but its still not updating. Any further advice on this subject would be appreciated.
.
View 1 Replies
View Related
Aug 29, 2007
After finally noticing that SQL Express has been updated to SP2, do I have to remove the existing version first? I am planning on installing Express Advanced. The online information that I read indicates that beta releases need to be removed. I wanted to ask just to be sure.
Thanks,
Edward K.
View 1 Replies
View Related
Jun 7, 2007
If SQL Express has no SQL Agent then FT catalogs cannot be autoupdated, automatically reflect user data in catalogs?
I cannot solve problem with automatically indexing data in SQL Express FTS.
View 4 Replies
View Related
Mar 20, 2008
I'm using VB.NET on VS 2005 with SQL 2005 Express. I have one master table with two child tables related with a FK. The master table in the SQL 2005 database has an Identity Column set up as the primary key with Increment as "1" and Seed as "1001". Each child table in the database has one Identity Column set as a primary key also with Increment = 1 Seed = 1001. Each child table also has a column set as a foreign key to the master primary key. The typed dataset was created in Designer and the table adapters, bindingsources, bindingnavigator and DGVs were created by dropping the tables on the form. I added some code for each child table in the bindingsource button save event for the two additional child tables:
' my added code
child1BindingSource.EndEdit
childT1ableAdapter.Update(ds.Child1Table)
child2BindingSource.EndEdit
child2TableAdapter.Update(ds.Child2Table)
Now the trouble. I changed the dataset (not the actual database) columns for each table's PK to AutoIncrement with Seed "-1" and Step "-1" to allow the client to create new records that do NOT match an existing key in the backend database. I've read on the forums where this is best pratice to prevent collisions. Please correct me if this is not true. When I create a new record by clicking the "+" button on the binding navigator, I see the "-1" inserted into the correct bound field for the primary key column of the parent table. I can then click into either or both the child DGV empty rows and see that same "-1" value appear in the correct FK column of the DGV. Everything looks good until I try and save the newly added rows were I get the "The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Parent_Child" error. If I change the dataset back to Seed 1, Step 1 then it does not throw an error during save and does save the child data. However the value of the Primary key on the DGV cells displays the value "1001" (or the next auto incrementing value) and NOT "1" which is the seed value for that dataset's table's primary key column. I can change the Seed and Step back to "-1" on the dataset tables and get the error during save or change the dataset table primary key column to Seed 1, Step 1 and the data is saved but with an incorrect identity value. Why does it use the identity value from the database and not the dataset? It seems to me it should work the same no matter what I assign to the autonumber seed value.
I had previously posted this in the Windows Forms forum but with no solution.
Regards,
DeBug
View 1 Replies
View Related
Dec 7, 2006
Hi,
I am currently using VC++/Cli 2005. In a project, I'm using a DataGridView control to show records from a SQL Express 2005 table. Instead of updating a specific item directly within DataGridView control, I would like to open a new form and allow user to update selected record/item within that form. The reason to update this way is conditionned by the fact that I have 3 levels of detail as following:
Level 0 Level 1 Level 2
1:N 1:N
Furniture --> Component --> Component
You all understand that update form of Level1 will/must include, as Level0 do, another DataGridView control to display/detail all related items issued from next level. This explains why I can't allow user to update Level 1 directly from DataGridView control.
I've searched in MSDN and even bought a few books on subject but unfortunately I found nothing on how to do it this way. All articles on DataGridView control were only showing how to update record directly from control.
My approach, I think, would be to transmit to my level1 updating form, as a single parameter, the selected DataRow object (or a brand new one if currently adding) issued from DataGridView and let user update it's content. When User finally leaves level0 update form, then I presume that DataGridView corresponding table would be automatically updated according to DataGridView's content.
What would be the proper way to do it? I would certainly appreciate to hear you view on this.
Also, what can I do if I want to refresh DataGridView's content when coming back from update form. Is it done automatically? I would certainly be sure that it reflects the reality, not only when I update it myself but also especially when other users could concurrently update same records?
Thanks in advance,
Stéphane
View 7 Replies
View Related
Jun 29, 2007
During web-site development, I am using VStudio 2005 with SQL-Express. I frequently publish changes to my web server that is running SQL- Server 2000 standard edition.
Is there a simple way to replicate changes in database tables design without copying the whole mdf-file and loosing the existing data in the target database?
thanks, Reinhard
View 3 Replies
View Related
May 1, 2008
Hello, I'm installing MOSS 2007 as stand alone which includes SQL Server 2005 Express edition. My install is failing during the DB install. The server is Windows Server 2003, Enterprise Edition SP 2.
The error I'm receiving states "Setup has encountered an unexpected error while updating security settings on HTTP Services".
Here are snippets including the "return value 3" found in the log "SQLSetup0001_COHNTFS15_SQL.log".
Snippet 1:
<Func Name='LaunchFunction'>
Function=Do_sqlPerfmon2
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='0'>
Doing Action: Do_sqlPerfmon2
PerfTime Start: Do_sqlPerfmon2 : Thu May 01 08:36:14 2008
<Func Name='Do_sqlPerfmon2'>
<EndFunc Name='Do_sqlPerfmon2' Return='0' GetLastError='2'>
PerfTime Stop: Do_sqlPerfmon2 : Thu May 01 08:36:14 2008
MSI (s) (D8:EC) [08:36:14:535]: Executing op: ActionStart(Name=Do_PropSetLoginModeNT.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Setting SQL Server Authentication Mode,)
<EndFunc Name='LaunchFunction' Return='0' GetLastError='0'>
MSI (s) (D8:EC) [08:36:14:535]: Executing op: CustomActionSchedule(Action=Do_PropSetLoginModeNT.D20239D7_E87C_40C9_9837_E70B8D4882C2,ActionType=1025,Source=BinaryData,Target=Do_PropSetLoginModeNT,CustomActionData=010Setting SQL Server Authentication Mode50000MSSQL.1)
MSI (s) (D8:40) [08:36:14:535]: Invoking remote custom action. DLL: C:WINDOWSInstallerMSI538.tmp, Entrypoint: Do_PropSetLoginModeNT
<Func Name='LaunchFunction'>
Function=Do_PropSetLoginModeNT
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='0'>
Doing Action: Do_PropSetLoginModeNT
PerfTime Start: Do_PropSetLoginModeNT : Thu May 01 08:36:14 2008
<Func Name='Do_PropSetLoginModeNT'>
Switching server to NT integrated security
<EndFunc Name='Do_PropSetLoginModeNT' Return='0' GetLastError='0'>
PerfTime Stop: Do_PropSetLoginModeNT : Thu May 01 08:36:14 2008
MSI (s) (D8:EC) [08:36:14:566]: Executing op: ActionStart(Name=Do_HttpServiceSecurity.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Updating security settings on HTTP services,)
<EndFunc Name='LaunchFunction' Return='0' GetLastError='0'>
MSI (s) (D8:EC) [08:36:14:566]: Executing op: CustomActionSchedule(Action=Do_HttpServiceSecurity.D20239D7_E87C_40C9_9837_E70B8D4882C2,ActionType=1025,Source=BinaryData,Target=Do_HttpServiceSecurity,CustomActionData=100Updating security settings on HTTP services100000)
MSI (s) (D84) [08:36:14:566]: Invoking remote custom action. DLL: C:WINDOWSInstallerMSI539.tmp, Entrypoint: Do_HttpServiceSecurity
<Func Name='LaunchFunction'>
Function=Do_HttpServiceSecurity
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='T' GetLastError='0'>
Doing Action: Do_HttpServiceSecurity
PerfTime Start: Do_HttpServiceSecurity : Thu May 01 08:36:14 2008
<Func Name='Do_HttpServiceSecurity'>
Error updating HTTPFilter service security (5)
<EndFunc Name='Do_HttpServiceSecurity' Return='1603' GetLastError='0'>
PerfTime Stop: Do_HttpServiceSecurity : Thu May 01 08:36:14 2008
Gathering darwin properties for failure handling.
Error Code: 1603
MSI (s) (D8!20) [08:36:14:785]: Product: Microsoft SQL Server 2005 Express Edition -- Error 29528. The setup has encountered an unexpected error while Updating security settings on HTTP services. The error is: Fatal error during installation.
Error 29528. The setup has encountered an unexpected error while Updating security settings on HTTP services. The error is: Fatal error during installation.
<Failure Type='Fatal' Error='1603'>
<EndFunc Name='LaunchFunction' Return='1603' GetLastError='0'>
MSI (s) (D8:EC) [08:36:14:800]: User policy value 'DisableRollback' is 0
MSI (s) (D8:EC) [08:36:14:800]: Machine policy value 'DisableRollback' is 0
Action ended 8:36:14: InstallFinalize. Return value 3.
Snippet 2:
<Func Name='LaunchFunction'>
Function=Set_CommitFlag
<Func Name='GetCAContext'>
<EndFunc Name='GetCAContext' Return='F' GetLastError='0'>
Doing Action: Set_CommitFlag
PerfTime Start: Set_CommitFlag : Thu May 01 08:36:22 2008
<Func Name='Set_CommitFlag'>
Set_CommitFlag called successfully.Rollbacked
<EndFunc Name='Set_CommitFlag' Return='0' GetLastError='0'>
PerfTime Stop: Set_CommitFlag : Thu May 01 08:36:22 2008
<EndFunc Name='LaunchFunction' Return='0' GetLastError='0'>
MSI (s) (D8:EC) [08:36:22:988]: Executing op: ActionStart(Name=RollbackSupportFiles.D20239D7_E87C_40C9_9837_E70B8D4882C2,Description=Removing temporary files,)
MSI (s) (D8:EC) [08:36:22:988]: Executing op: CustomActionRollback(Action=RollbackSupportFiles.D20239D7_E87C_40C9_9837_E70B8D4882C2,ActionType=1281,Source=BinaryData,Target=RollbackSupportFiles,)
MSI (s) (D8:7C) [08:36:22:988]: Invoking remote custom action. DLL: C:WINDOWSInstallerMSI54B.tmp, Entrypoint: RollbackSupportFiles
MSI (s) (D8:EC) [08:36:23:004]: Executing op: End(Checksum=0,ProgressTotalHDWord=0,ProgressTotalLDWord=0)
MSI (s) (D8:EC) [08:36:23:004]: Error in rollback skipped. Return: 5
MSI (s) (D8:EC) [08:36:23:004]: Entering MsiProvideAssembly. AssemblyName: Microsoft.AnalysisServices.AdomdClient,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:004]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:019]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:019]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.Instapi,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:019]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:019]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:019]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.SqlTDiagM,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:019]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:035]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:035]: Entering MsiProvideAssembly. AssemblyName: MSClusterLib,Version="1.0.0.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="1.0.0.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:035]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:050]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:050]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.MgdSqlDumper,Version="9.0.242.0",Culture="neutral",processorArchitecture="x86",PublicKeyToken="89845dcd8080cc91",FileVersion="2005.90.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:050]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:050]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:050]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.Rmo,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:050]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:066]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:066]: Entering MsiProvideAssembly. AssemblyName: Microsoft.AnalysisServices.DeploymentEngine,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:066]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:082]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:082]: Entering MsiProvideAssembly. AssemblyName: Microsoft.AnalysisServices,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:082]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:082]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:082]: Entering MsiProvideAssembly. AssemblyName: Microsoft.DataWarehouse.Interfaces,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:082]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:097]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:097]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.RegSvrEnum,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:097]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:113]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:113]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.BatchParser,Version="9.0.242.0",Culture="neutral",processorArchitecture="x86",PublicKeyToken="89845dcd8080cc91",FileVersion="2005.90.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:113]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:113]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:113]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.ServiceBrokerEnum,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:113]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:129]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:129]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.WmiEnum,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:129]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:144]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:144]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.ConnectionInfo,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:144]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:160]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:160]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.SqlEnum,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:160]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:207]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:207]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.SmoEnum,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:207]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:207]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:207]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.SString,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.1399.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:207]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:222]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:222]: Entering MsiProvideAssembly. AssemblyName: Microsoft.SqlServer.Smo,Version="9.0.242.0",Culture="neutral",processorArchitecture="MSIL",PublicKeyToken="89845dcd8080cc91",FileVersion="9.0.2047.0", AppContext: , InstallMode: -4
MSI (s) (D8:EC) [08:36:23:222]: Pathbuf: 0, pcchPathBuf: 0
MSI (s) (D8:EC) [08:36:23:238]: MsiProvideAssembly is returning: 1607
MSI (s) (D8:EC) [08:36:23:238]: No System Restore sequence number for this installation.
MSI (s) (D8:EC) [08:36:23:238]: Unlocking Server
MSI (s) (D8:EC) [08:36:23:238]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'.
Action ended 8:36:23: INSTALL. Return value 3.
last few lines of log:
Property(S): RSVirtualDirectoryManager = Reports$OFFICESERVERS
Property(S): SOURCEDIR = d:a1847ef4f3beaf9c2353Setup
Property(S): SourcedirProduct = {2AFFFDD7-ED85-4A90-8C52-5DA9EBDC9B8F}
Property(S): InstallNgenTicks = 110000
Property(S): SQLBROWSERACCOUNT = NT AUTHORITYNETWORK SERVICE
Property(S): SQLBROWSERSCMACCOUNT = NT AUTHORITYNetworkService
Property(S): SQLSCMACCOUNT = NT AUTHORITYNetworkService
Property(S): DebugClsid.CC1A8C58_27D1_4D38_BF1B_C0A5CBB90616 = {B266876E-56D9-493C-9322-0C01155F1C52}
Property(S): ProductToBeRegistered = 1
MSI (s) (D8:EC) [08:36:23:441]: Note: 1: 1708
MSI (s) (D8:EC) [08:36:23:441]: Product: Microsoft SQL Server 2005 Express Edition -- Installation failed.
MSI (s) (D8:EC) [08:36:23:457]: Cleaning up uninstalled install packages, if any exist
MSI (s) (D8:EC) [08:36:23:457]: MainEngineThread is returning 1603
MSI (s) (D84) [08:36:23:566]: Destroying RemoteAPI object.
MSI (s) (D8:E0) [08:36:23:566]: Custom Action Manager thread ending.
=== Logging stopped: 5/1/2008 8:36:23 ===
MSI (c) (104) [08:36:23:597]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (104) [08:36:23:597]: MainEngineThread is returning 1603
=== Verbose logging stopped: 5/1/2008 8:36:23 ===
I'm suspecting it's a permission error, but I can't verify this. Any thoughts? Thanks in advance.
View 5 Replies
View Related
May 11, 2007
Can someone provide a step by step tutorial for this? I'd like to safely update a database that is used for a website without much or any downtime.
View 1 Replies
View Related
Jan 30, 2007
I have my first small SQl Server 2005 database developed on my localserver and I have also its equivalent as an online database.I wish to update the local database (using and asp.net interface) andthen to upload the data (at least the amended data, but given thesmall size all data should be no trouble) to the online database.I think replication is the straight answer but I have no experience ofthis and I am wondering what else I might use which might be lesscomplicated. One solution is DTS (using SQL 2000 terms) but i am notsure if I can set this up (1) to overwrite existing tables and (2) notto seemingly remove identity attributes from fields set as identities.I know there are other possibilities but I would be glad of advice asto the likely best method for a small database updated perhaps onceweekly or at less frequent intervals,Best wishes, John Morgan
View 3 Replies
View Related
Aug 1, 2007
Hi,
How do I insert data that I have collected in a local database onto a table on my online ie hosted database which is on a different server?
At the moment I am just uploading all the data to the hosted DB but this is wasting bandwith as only a small percentage of data is actually selected and used.
I thought that if i used a local DB and then update the table on my hosted DB this would be much more efficient, but I am not sure how to write the SQL code to do this!
Do I do some kind of
INSERT INTO sample_table
SELECT xxx
FROM origanal_table
Or is it more complicated than this?
Thanks
View 6 Replies
View Related
Jul 1, 2004
I got thrown into a new project that is going to require me to update an SQL server database tables from an Access table on the backend of an Oracle database on another server. At the end of each day the Access dabase will be updated from the Oracle database.
What I need to do, is when the Access database is updated I need to have the table in the SQL database automaticaly updated. When a new record is added to the Access table I need the new record added to the SQL table. When a record is deleted in the Access table I need to keep that record in the SQL table and set a field to a value (such as 0). And when a record is updated in Access, have it updated in SQL.
Needless to say this is a bit out of my area and not sure how to accomplish this.
Any help is greatly appreciated.
View 2 Replies
View Related
Jul 27, 2006
i have sql 2005 installed on my personal machine, but our server has sql 2000 on it. the structure of my database was made on the server, but i'm not sure how to update the server copy from my local copy. when i try to export my data from my local machine to the server (or import from my local machine to the server), i get pre-execute errors.
roughly every other week, i'll need to be able to update the server version from my local version, so i'm trying to find the most efficient method. what is the best way to update a 2000 database from a 2005 database? it doesn't matter if i append or overwrite, but i do use identity fields. the error i get when trying to use the import/export wizard is:
- Pre-execute (Error)
Messages
Error 0xc0202009: Data Flow Task: An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".
(SQL Server Import and Export Wizard)
Error 0xc0202025: Data Flow Task: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
(SQL Server Import and Export Wizard)
Error 0xc004701a: Data Flow Task: component "Destination 3 - ReleaseNotes" (202) failed the pre-execute phase and returned error code 0xC0202025.
(SQL Server Import and Export Wizard)
View 4 Replies
View Related
Mar 7, 2007
Hi All:
Appreciate your efforts in answering queries of so many newbees!I hope to find answering my query..I
have created a logon screen to which i have also given the option of
changing the password ... Now below is the code for updating the new
password given by the user ....Imports System.Data.SqlClient Dim con As New SqlConnection("server=sys2;initial catalog=kris;integrated security=SSPI") Dim cmd As New SqlCommand("select * from u_login", con) Dim dr As SqlDataReader Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click con.Open() dr = cmd.ExecuteReader While dr.Read() If dr(0) = txtEmail.Text And dr(1) = txtoldpwd.Text Then Dim NewPwdStr As String = txtnewpwd.Text Dim OldPwdStr As String = txtoldpwd.Text Dim sqlstr As String = "Update U_Login set pwd = ('" & NewPwdStr & "') Where pwd = '" & OldPwdStr & "'" Dim cmd1 As New SqlCommand("sqlstr", con) cmd1.ExecuteNonQuery() Response.Write(" Password Changed ... Please login again") End If End While dr.Close() con.Close() End Sub The above code although doesnt
throw any error however it shows a blank screen and doesnt even update
the new password. Can you plz help me understand what could possibly be
wrong in my code n why is that am getting the blank screen. Your help will be highly appreciated!Thanks,Brandy
View 6 Replies
View Related
May 25, 2005
Im sorry for how simple this question is im.. brand new at this.I am trying to write a program that will take information entered in 4 txt fields on a webform and populate a sql database with them with a submit button.. Eventually its going to be a updateable phone list for my department but for now im just trying to get the submit button to work. More then anything i just need a good resourse to read up on it. Thankyou Adam
View 2 Replies
View Related
Nov 15, 2003
At present I am working on a school project. the project was installed few months back. database is MSsql server.
Because of some new things i had to change few tables, add few columns and add few tables also. Now My problem is that the school is already having the data which they don't want to be disturbed . So I want My structure and their data.
:confused: :(
Please Help Me.
View 4 Replies
View Related
Jul 20, 2005
I'm having a difficult time calling UPDATE when my 'WHERE" clause calls ID,which is numeric and the primary key. I found that I can do a SELECT justfine with "WHERE ID".. Is there something special about UPDATE that i'm notgetting? I've searched the internet but it appears that what I'm doingshould work.Any help would be greatly appreciated.if (modcustomer == "relate"){var modid1 = Request.Form ("modid1");var modid2 = Request.Form ("modid2");var relationship = Request.Form ("relationship");var comments = Request.Form("comments");SqlString = "UPDATE Customer SET Relationship = ' " + relationship + " 'WHERE ID = " + modid1;connection.Execute (SqlString);}thanks,Debbie EhrlichReliable Software - Developers of Code Co-op®, Server-less version controlfor distributed teams www.relisoft.com
View 3 Replies
View Related
May 17, 2006
Can someone please tell me what I am missing... I am trying to update a record with information a user types into a textbox. I am not getting any errors even when in DEBUG mode. But yet the Data is not getting updated.
Any Help would be very much appreciated.
T
CODE:
Protected Sub bUpdateSlsNum_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bUpdateSlsNum.Click
Dim myCommand As SqlCommand
Dim myConnection As SqlConnection
myConnection = New SqlConnection("Server=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CustomerInfo.mdf;Integrated Security=True;User Instance=True")
Dim UpdateCmd As String = "UPDATE CustomerSalesNum SET WorkSheetID=@WorkSheetID, Price=@Price, Freight=@Freight, Setup=@Setup, " _
& "Injection=@Injection, Wheels=@Wheels, Security=@Security, SubTotal=@SubTotal, DocFee=@DocFee, TradeInAllow=@TradeInAllow, TaxAmount=@TaxAmount, SalesTax=@SalesTax, " _
& "TradeLienBal=@TradeLienBal, Other=@Other, PAQuote=@PAQuote, TitleFee=@TitleFee, DownPay=@DownPay, Total=@Total WHERE [WorkSheetID]= '" & "@" & lblRWorkSheetID.Text & "'"
myCommand = New SqlCommand(UpdateCmd, myConnection)
myCommand.Parameters.Add(New SqlParameter("@WorkSheetID", Data.SqlDbType.NVarChar))
myCommand.Parameters("@WorkSheetID").Value = lblRWorkSheetID.Text
myCommand.Parameters.Add(New SqlParameter("@Price", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Price").Value = tbUPPRice.Text
myCommand.Parameters.Add(New SqlParameter("@Freight", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Freight").Value = tbUPFreight.Text
myCommand.Parameters.Add(New SqlParameter("@Setup", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Setup").Value = tbUPSetup.Text
myCommand.Parameters.Add(New SqlParameter("@Injection", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Injection").Value = tbUPInjection.Text
myCommand.Parameters.Add(New SqlParameter("@Wheels", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Wheels").Value = tbUPWheels.Text
myCommand.Parameters.Add(New SqlParameter("@Security", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Security").Value = tbUPFactorySec.Text
myCommand.Parameters.Add(New SqlParameter("@SubTotal", Data.SqlDbType.NVarChar))
myCommand.Parameters("@SubTotal").Value = tbUPSUBT.Text
myCommand.Parameters.Add(New SqlParameter("@DocFee", Data.SqlDbType.NVarChar))
myCommand.Parameters("@DocFee").Value = tbUPDOCFee.Text
myCommand.Parameters.Add(New SqlParameter("@TradeInAllow", Data.SqlDbType.NVarChar))
myCommand.Parameters("@TradeInAllow").Value = tbUPTIA.Text
myCommand.Parameters.Add(New SqlParameter("@TaxAmount", Data.SqlDbType.NVarChar))
myCommand.Parameters("@TaxAmount").Value = tbUPTAX.Text
myCommand.Parameters.Add(New SqlParameter("@SalesTax", Data.SqlDbType.NVarChar))
myCommand.Parameters("@SalesTax").Value = tbUPSALETAX.Text
myCommand.Parameters.Add(New SqlParameter("@TradeLienBal", Data.SqlDbType.NVarChar))
myCommand.Parameters("@TradeLienBal").Value = tbUPTILB.Text
myCommand.Parameters.Add(New SqlParameter("@Other", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Other").Value = tbUPOther.Text
myCommand.Parameters.Add(New SqlParameter("@PAQuote", Data.SqlDbType.NVarChar))
myCommand.Parameters("@PAQuote").Value = tbUPPAQuote.Text
myCommand.Parameters.Add(New SqlParameter("@TitleFee", Data.SqlDbType.NVarChar))
myCommand.Parameters("@TitleFee").Value = tbUPTitle.Text
myCommand.Parameters.Add(New SqlParameter("@DownPay", Data.SqlDbType.NVarChar))
myCommand.Parameters("@DownPay").Value = tbUPDownPay.Text
myCommand.Parameters.Add(New SqlParameter("@Total", Data.SqlDbType.NVarChar))
myCommand.Parameters("@Total").Value = LBLUTOTAL.Text
myCommand.Connection.Open()
Try
myCommand.ExecuteNonQuery()
ShowMessageBox(Me, "ATTENTION: Customer Data has been Updated.")
bUpdateSlsNum.Enabled = False
Catch ex As SqlException
If ex.Number = 2627 Then
ShowMessageBox(Me, "ERROR: A record already exists with " _
& "the same primary key")
Else
ShowMessageBox(Me, "ERROR: Could not add record")
End If
End Try
myCommand.Connection.Close()
MVMain.ActiveViewIndex = -1
End Sub
View 6 Replies
View Related
Feb 9, 2008
Hi,
I have designed a Contacts application, where I store all the Contacts in a SQL Database.
Now, I am deploying this application using Visual Studio 2005 Setup and Deployment project.
I might need the update the database with additional Columns etc at a later stage.
How, can I update the SQL Database after it has been deployed on a client computer?
Please assist
Thanks
View 8 Replies
View Related
Mar 21, 2007
This is a weird problem. I added a database to the app_data folder, but when I make updates and then run some reports the updates aren't shown. The database is updated, cause queries show the updates and I inspected the database. The updates however, aren't being reflected when I run the reports.
View 5 Replies
View Related
Mar 26, 2007
I have a web project created with VS2005 that is connected to a database on an SQL Server. I've created a data diagram on the SQL Server and created a matching dataset in my project. The data diagram has the 'enforce relationship...' and cascade textboxes checked for the table relationships. My dataset has 'both relation and foreign key constraint' checked with the rules all set to cascade. The code creates a table adapter then does the tableadapter.Update. The data gets added to my main table, but not to any of the child tables. Any ideas on what could be causing this?
Thanks,Rhonda
View 4 Replies
View Related
Mar 28, 2007
I am wondering how some of you update your database once it is already been in use. So take for example you have a few tables and users can enter data into the site. Now suppose you either add tables to the db or you add fields to an existing table. I am using sql express 2005 and just want to copy the db over with the copy website but it would overwrite any data users entered.Is there any easy solutions or suggestions for this.Thanks
View 1 Replies
View Related
Jan 8, 2008
I am quite new to ASP.net 2.0. I have had plenty of experience using ADO.net in standard windows applications.
In my app I am opening a connection to an SQL database and I am creating a DataTable without a DataSet:
Shared m_cnADONetConnection As New System.Data.SqlClient.SqlConnection
Shared m_daDataAdapter As System.Data.SqlClient.SqlDataAdapter
Shared m_rowPosition As Integer
Shared m_dtContacts As New System.Data.DataTable
I am initializing everything and filling my DataTable when the Page first Loads if it isnt a postback.Protected Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Form1.Load
If Not Page.IsPostBack Then
m_rowPosition = 0
m_cnADONetConnection.ConnectionString = "Data Source=.SQLEXPRESS;AttachDbFilename=C:First ASP DatabaseApp_DataMyFirstDatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
m_cnADONetConnection.Open()m_daDataAdapter = New System.Data.SqlClient.SqlDataAdapter("Select * From Books", m_cnADONetConnection)m_cbRefillCommand = New System.Data.SqlClient.SqlCommand
m_daDataAdapter.Fill(m_dtContacts)
Me.ShowCurrentRecord()
End IfEnd Sub
The Me.ShowCurrentRecord Sub assigns the values of the current record(row) in the DataTable via (m_rowPosition) to TextBox controls on the form:
I also have record navigation buttons on my form: << < > >> Moving me from record to record (row to row) by incrementing or decrementing m_rowPosition
All is good! I am able navigate the DataTable and the textboxes change their text properties accordingly from record to record.
The only other control on my form is a button which I'm coding its click event to save changes that I made to the current row (record) by changing the values in the textboxes then clicking save.
Here is my code:Protected Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
If m_dtContacts.Rows.Count <> 0 Then
m_dtContacts.Rows(m_rowPosition).BeginEdit()m_dtContacts.Rows(m_rowPosition)("Title") = TBTitle.Text
m_dtContacts.Rows(m_rowPosition)("Author") = TBAuthor.Textm_dtContacts.Rows(m_rowPosition)("YearPublished") = TBYearPublished.Text
m_dtContacts.Rows(m_rowPosition)("Price") = TBPrice.Textm_dtContacts.Rows(m_rowPosition)("LastReadOn") = TBLastReadOn.Textm_dtContacts.Rows(m_rowPosition)("PageCount") = TBPageCount.Text
m_dtContacts.Rows(m_rowPosition).AcceptChanges()
m_dtContacts.Rows(m_rowPosition).EndEdit()
m_dtContacts.AcceptChanges()
m_daDataAdapter.Update(m_dtContacts)
End Sub
After I click save I can navigate through my records and back to the one I just changed and updated and all is well. The changes were made in the table.
However, when I close the page and exit out of Visual Web Developer and reopen the database: THE CHANGES WERENT UPDATED!!!
This worked all the time in VB2005.net when developing a standard windows app.
Can I use the same approach I was using in my code above or am I missing something.
I have read and searched all over and what I'm thinking is that my UpdateCommand, InsertCommand, DeleteCommand, SelectCommand are empty.
Do I have to do it this way?
View 1 Replies
View Related
Jan 19, 2004
Hello all
Can any one help me in updateing the dataBase with the updated datset through the DataGrid
i am able to get the updated dataset from the data Grid but i dont know how to update the database with that
kindly help
View 1 Replies
View Related
Oct 28, 2004
Hi all,
I'm getting an error when updating my database. The connection is fine and the dropdown menu is good also so i think it's the way i've formed my sql string. Here's the line i think i'm having probs with:
SQLString = "UPDATE project_descriptions SET " & _
"lecturer_name = '" & Replace(LecturerName.Text,"'","''") & "'," & _
"project_title = '" & Replace(ProjectTitle.Text,"'","''") & "', " & _
"Project_description = '" & Replace(ProjectDescription.Text,"'","''") & "'," & _
" WHERE project_code = '" & ProjectCode.SelectedItem.Value & "'"
Can anyone rearrange it so i stop getting an error?
Here's my code. if it helps.
<%@ Import Namespace="System.Data.OleDb" %>
<SCRIPT language="VB" runat="server">
Dim DBConnection As OleDbConnection
Dim DBCommand As OleDbCommand
Dim DBReader As OleDbDataReader
Dim SQLString As String
Sub Page_Load
If Not Page.IsPostBack Then
'-- Load drop-down list with item numbers
DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()
SQLString = "SELECT project_code FROM project_descriptions ORDER BY project_code"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBReader = DBCommand.ExecuteReader()
ProjectCode.DataSource = DBReader
ProjectCode.DataTextField = "project_code"
ProjectCode.DataValueField = "project_code"
ProjectCode.DataBind()
DBReader.Close()
DBConnection.Close()
End If
End Sub
Sub SelectRecord (Src As Object, Args As EventArgs)
DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()
SQLString = "SELECT * FROM project_descriptions WHERE " & _
"project_code = '" & ProjectCode.SelectedItem.Value & "'"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBReader = DBCommand.ExecuteReader()
DBReader.Read()
LecturerName.Text = DBReader("lecturer_name")
ProjectTitle.Text = DBReader("project_title")
ProjectDescription.Text = DBReader("project_description")
DBReader.Close()
DBConnection.Close()
UpdateButton.Visible = True
End Sub
Sub UpdateRecord (Src As Object, Args As EventArgs)
'-- CHECK FOR VALID RECORD ---
Dim ValidRecord As Boolean = True
'-- Check for missing Project Title
If ProjectTitle.Text = "" Then
ProjectTitleMessage.Text = "Missing Project Title"
ValidRecord = False
End If
'-- Check for missing Lecturer Name
If LecturerName.Text = "" Then
LecturerNameMessage.Text = "Missing Lecturer Name"
ValidRecord = False
End If
'-- Check for missing Project Description
If ProjectDescription.Text = "" Then
ProjectDescriptionMessage.Text = "Missing Project Description"
ValidRecord = False
End If
If ValidRecord = True Then
'-- UPDATE A RECORD --
Try
DBConnection = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:finalyearproject2projectallocation.mdb")
DBConnection.Open()
SQLString = "UPDATE project_descriptions SET " "lecturer_name = '" & Replace(LecturerName.Text,"'","''") & "'," "project_title = '" & Replace(ProjectTitle.Text,"'","''") & "', " "Project_description = '" & Replace(ProjectDescription.Text,"'","''") & "'," " WHERE project_code = '" & ProjectCode.SelectedItem.Value & "'"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBCommand.ExecuteNonQuery
DBConnection.Close()
UpdateMessage.Text = "Record updated"
Catch
UpdateMessage.Text = "Update problem. Record not changed. " & SQLString
End Try
End If
End Sub
</SCRIPT>
<html>
<head>
<style>
.head {font-family:arial; font-size:12pt; font-weight:bold; width:560px;
border:outset 1 #F0F0F0; padding:2pt; background-color:#990000;
color:#FFFFFF; text-align:center}
.box {font-family:arial; font-size:8pt; line-height:9pt; width:200px;
height:20px; overflow:auto}
.right {text-align:right}
.center {text-align:center}
table {font-family:arial; font-size:8pt; line-height:9pt; width:560px;
background-color:#F9F9F9; border-collapse:collapse}
th {font-family:arial; font-size:8pt; line-height:14pt;
font-weight:bold; text-align:center; vertical-align:bottom;
background-color:#990000; color:#FFFFFF}
td {font-family:arial; font-size:8pt; line-height:9pt;
vertical-align:top}
</style>
</head>
<body>
<form runat="server">
<div class="head">Project Update</div>
<table id="UpdateTable" border="1" rules="rows">
<tr>
<th> Project Code: </th>
<td><asp:DropDownList id="ProjectCode" runat="server"/>
<asp:Button Text="Select" OnClick="SelectRecord" runat="server"/>
</td>
<td></td>
</tr>
<tr>
<th> Lecturer Name: </th>
<td><asp:TextBox id="LecturerName" runat="server"
Columns="40"
MaxLength="50"/></td>
<td><asp:Label id="LecturerNameMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>
<tr>
<th> Project Title: </th>
<td><asp:TextBox id="ProjectTitle" runat="server"
Columns="40"
MaxLength="50"/></td>
<td><asp:Label id="ProjectTitleMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>
<tr>
<th> Project Description: </th>
<td><asp:TextBox id="ProjectDescription" runat="server"
TextMode="MultiLine"
Columns="45"
rows="3"/></td>
<td><asp:Label id="ProjectDescriptionMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/></td>
</tr>
</asp:Panel>
</table>
<br>
<asp:Button id="UpdateButton" runat="server"
Text="Update Record"
Visible="False"
OnClick="UpdateRecord"/>
<asp:Label id="UpdateMessage" runat="server"
ForeColor="#FF0000"
EnableViewState="False"/>
</form>
</body>
</html>
View 4 Replies
View Related
Aug 18, 2005
I'm trying to build a record update form and I'm
going off the "Build Your Own ASP.NET Website" book. I'm not getting
any compilation errors; the database just doesn't update.
void Update(Object s, EventArgs e) {
SqlConnection upConn = new SqlConnection(
"Server=****\netsdk; database=CLASSIFIEDS; User ID=****; Password=****;");
SqlCommand upCmd;
upCmd = new SqlCommand("UPDATE CLASSIFIEDUSER SET
ITEMHEADLINE=@ITEMHEADLINE, ITEMDESCRIPTION=@ITEMDESCRIPTION,
CONTACTNAME=@CONTACTNAME, EMAIL=@EMAIL, HOMEPHONE=@HOMEPHONE,
WORKPHONE=@WORKPHONE, CELLPHONE=@CELLPHONE, BUILDING=@BUILDING,
ROOM=@ROOM, PRICE=@PRICE WHERE ID=@ID", upConn);
upCmd.Parameters.Add("@ITEMHEADLINE", headline.Text);
upCmd.Parameters.Add("@ITEMDESCRIPTION", description.Text);
upCmd.Parameters.Add("@CONTACTNAME", contact.Text);
upCmd.Parameters.Add("@EMAIL", email.Text);
upCmd.Parameters.Add("@HOMEPHONE", home.Text);
upCmd.Parameters.Add("@WORKPHONE", work.Text);
upCmd.Parameters.Add("@CELLPHONE", cell.Text);
upCmd.Parameters.Add("@BUILDING", building.Text);
upCmd.Parameters.Add("@ROOM", room.Text);
upCmd.Parameters.Add("@PRICE", price.Text);
upCmd.Parameters.Add("@ID", Request.QueryString["id"]);
upConn.Open();
upCmd.ExecuteNonQuery();
upConn.Close();
Response.Redirect("preview.aspx?id=" + Request.QueryString["id"]);
}
The Response.Redirect works so I'm thinking there must be an SQL syntax error or something but I can't see it.
View 16 Replies
View Related
Oct 11, 2006
Hello
I am happy with my mySQL install. I can quite happily created tables and fill them with initial data using mySQL Client
What I want to do now is via a web browser be able to add data to various tables etc. I need to make the web entering part of it as simple as possible for the users.
Cheers
View 3 Replies
View Related
Jun 27, 2007
Although the codes get correctly compiled and executed the tables on the database are not getting updated. I also used the execute sql command manually but it also doesnt work.
:-(
What to do?
View 3 Replies
View Related
Nov 24, 2007
Hai to All
I am preparing a desktop application in Visual Basic 2005 with SQL Server 2005(working with Local Database). Regarding application, my client wants to install the same application in office and also in his laptop to work at home. It means the database is installed into two different locations. If any new records are inserted from multiple tables in desktop, then how can i update the data in the laptop, and vice-versa.
My client wants if he work in his laptop at home and bring back the database in his USB. then how can i update the data in the desktop. Even i want to check whether new records has been added in USB database.
Please give me solution for my problem. If possible, please write a code for me.
Is there any possible solution directly with SQL Server 2005 alone?
I am eagerly waiting for your reply.
Thanks.
Yours
Kashif Chotu
View 1 Replies
View Related
Jul 22, 2007
I am having the oddest problem. I can update the data in the dataset, but when I use the update command, or try to do a update manually it will not save the values back to the database.
public void insrtnewtime()
{
int begintime = 00;
int endtime = 23;
int countr;
int _minz;
do
{
begintime = begintime + 1;
string string_begintime_representation = begintime.ToString("00");
//now I have a valid string representations
int _year = 2007;
int _month = 1;
int _day = 1;
int _hour = int.Parse(string_begintime_representation);
_minz = 00;
//need to account for 60 minutes
do
{
//now I need to get a real nice representation to be shown for the visual display
DateTime temptime = new DateTime(_year, _month, _day, _hour, _minz, 0);
//Now I need to strip out just the time, and send it to my stored proc
string stringnewtime_rep_visual = temptime.ToString("t");
string stringnewtime_rep_visual24 = temptime.ToString("HH:mm");
this.tbl_strt_tmesTableAdapter.insrt_strt_times(stringnewtime_rep_visual24, stringnewtime_rep_visual);
_minz += 5;
}
while (_minz < 60);
countr = begintime;
} while (countr < endtime);
this.tbl_strt_tmesTableAdapter.Fill(this.lesson_plannerDataSet.tbl_strt_tmes);
try
{
tbl_strt_tmesTableAdapter.Update(lesson_plannerDataSet.tbl_strt_tmes);//this should save the values
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
the table adapter update, should send the values to the database, but for some reason, it is not. i can see the existing values from the database, along with my new values that i added in my loop, but those values are not being sent to the database when I invoke the update command on the data adapter.
Any help will be greatly appreciated. I am making this program for my wife who is a school teacher.
View 1 Replies
View Related
Dec 14, 2006
Hello again!I think what I need to do should be simple, but it is proving difficult.I am displaying a page with data drawn from three different SQL Server tables. Most of the fields on the page correspond to fields in one of the three tables, and these fields can be updated by the user. I then want to propagate these updates to SQL Server, refill the DataSet, and rebind.What I'm currently doing is basically this. I've set up a separate SqlCommand for this update. I have a ParameterCollection defined for this SqlCommand that includes the key field to be used in my WHERE clause and all the fields I want to update.When the user clicks on the [Save Customer Review] button, I (1) set the values of the parameters to the values of the corresponding screen fields, in most instances using one of the Convert methods so the data being assigned to the parameter has the correct type; (2) open an SqlConnection; (3) do SqlCommand1.ExecuteNonQuery(); (4) close the SqlConnection; (5) fill the DataSet; (6) bind.I've experienced multiple kinds of failure in this process, but the primary kinds of failure I've experienced are these:- The one value I'm actually updating (a text field) doesn't get updated on the database. No other fields are touched.- Two fields with Int values (SQL Server shows them as length 4; does that correspond to Int32?) are set to NULL.- The ExecuteNonQuery complains that I'm not supplying a value for the one field that is type DateTime. (In the SQL Server database, this field is permitted to be NULL, and in the record I'm playing with, it is in fact NULL. However, since TextBox.Value is of type String, I'm having to set it to Nothing [Visual Basic] if the text box is blank.)One thing I don't like about this is that I can't see what values the parameters are taking on as I do my processing, even in the debugger. At least I don't know of any way to examine or watch them. One reason this bothers me is that I have a rather strong suspicion that there's something wrong with the way I've set up the parameters, but I can't tell what's happening to them to confirm that, and I also can't see the SQL that's being generated (or can I?).Any thoughts?Thanks,TimPS Be gentle, please -- this is my first Web application. :-)
View 10 Replies
View Related
Apr 25, 2007
hi,
I have a problem with updating a row in my database. I don't know how to update and i need help.
I have a form where the users select a category and a sub category to enter a message.
I have two dropdown lists, one is for selecting the category and the other is for the sub-category.
In my database for the categories and the sub-categories, i have a variable (Quantity) where i keep the quantity for each table.
I just want to be able to increment this variable by 1 (for the selected category and sub-category) when a user enter a new message...
The insert procedure is working well and have no problem with it.
I use VWD 2005 Express with SQL 2005 express and i code in VB.HELP!!!!!
View 15 Replies
View Related
Sep 4, 2007
Hi GuysI am facing a problem while updating a DataTable to database using sqldataadapter.In my application I am fetching a dataTable from Database and filling values into textboxes on the UI.User has given facility to change or add new texboxes (new row) on the fly .(Textboxes on the UI are like in a row(tr) having two textboxes in each row.)I am again then converting a new (empty) datatable from scrap and filling its rows with the value of textboxes on submit button event.The datatable which I have created has the same schema as the database table.Now what I want here is that changed value should be reflected to the already existed rows in database and only new rows should be inserted.I am using a SQLDataAdapter having two sqlcommands , one for update with update procedure name and parameter mapping and another for insert with parameter mapping.But SqlDataAdapter is inserting fresh new rows all the time in the database table not updating the older one.Please help me in the matterThanks & RegardsVishal Sharma
View 2 Replies
View Related