Get identity of last inserted row in pervasive SQL - odbc

I'm trying to retrieve the identity of last inserted row and I want to use scope_identity. The system is developing in ASP.NET and pervasive SQL using ODBC. I thought my google skills were good but I can't find anything about this, is it even possible?
Grateful for any answer or someone pointing in any direction helping me solve this.

If the field has an Identity field, you can issue a SELECT ##identity to get the last identity value inserted.

Related

Dynamics AX 2009 X++: Fix id in modification of application after import version control

How to fix ID in modification of application?
This problem will appear after changing database, and importing version control with set parameters:
cover by system tables and shared
does not search for existing records
index update during import
The problem is that on a few tables will show an error message:
sql database reported an error
Do a full synchronize of the database.
Beware, it may remove then reinsert fields or tables, if the id changed.
If you know the exact issue, you can write a job to manually fix it.
This is a more advanced task, so if you're not totally comfortable with it, I'd try Jan's approach.
ReleaseUpdateDB::changeTableId(...);
ReleaseUpdateDB::changeFieldId(...);
ReleaseUpdateDB::change* stuff
Also, Martin wrote a job that does a lot of it for you. I had to tweak it myself before:
http://dev.goshoom.net/en/2011/11/id-change/

c++ builder with SQLite: data presentation shows WIDEMEMO in DBGrid

i use C++ Builder with SQLite database. I connect with the database through DBExpress. The problem is that DBGrid shows (WIDEMEMO) in every field and not the exact values that the database has.
I dont have this problem with other databases such as Firebird for example.
Why this behaviour? am i missing something with sqlite and how can be fixed.
Do u suggest me use SQLite / Firebird or other embeded database for a small standalone application.
Thanks in advance.
I am using FireDAC in Delphi and had the same problem.
I have resolved this issue by changing the dataset TWideMemoField DisplayValue property from dvClass to dvFull. Now my DBGrid works as expected.
I know this question is old but since it doesn't have any answer selected I will throw in my two cents. I recently came across the same problem and found a solution that might work for you as well.
This problem exists in your C++ DataSet and your SQLite. As it turns out that when you have a field with no defined size especially a text field, that field will be treated like a widememo or Memo in your DBGrid. So, what you need to do is define your text field with specific numbers of characters i.e. VARCHAR(10).
That's what I did and it work for me. I am using MySQL and Delphi with DBGrid.
This is a problem with the DBGrid. It doesn't handle the WIDEMEMO. See link for help with this.
Displaying and editing MEMO fields in Delphi's TDBGrid

Connection code to the database in asp.net

My database name is [chitomiho] and my table name is [trytable].
I want code for connecting to database and insert values into try table in asp.net
Here is a great tutorial on connecting to a database in ASP.Net. We're not here to write code for you, only to help you when you're stuck.
http://www.w3schools.com/aspnet/aspnet_dbconnection.asp
Dear Inspiron this is a forum question and not meant to be asked here. If you would have just googled it!!!!
You may find this helpful:
http://msdn.microsoft.com/en-us/library/ms178371.aspx

Asp.net - Trouble with updating LINQ Classes

We just created a new field in a database table, and so deleted, and re-inserted the table in the LINQ Class. The new database field appears in the LINQ Class in the diagram. However, when we're using the field, we get an error that says the table does not contain a definition for the field.
Any ideas on how we can solve this? Thanks!
UPDATE: What steps are required to update the LINQ to SQL Class? Maybe we're doing something wrong.
UPDATE 2: Picture of our problem - LINQ - http://img99.imageshack.us/img99/6033/usertable.png | Code - http://img43.imageshack.us/img43/5145/linqerror.png
Check the table def side of your mapping documents, either using properties in the designer, or by closing Studio and examining the XML. I recommend the designer.
Make sure the field name matches the field name in the database.
I've had problems with a few reserved keywords when using Linq2Entities, and I'd recommend you avoid reserved words in names (even though the [] handle them).
While this doesn't answer your question necessary, it may help to solve it - I've been a long time fan of the LINQ to SQL and Entities tools by Huagati. The re-sync aspect alone has saved me so much time, it's well worth the $50 (for the standard version) IMO.
http://www.huagati.com/dbmltools/
Hope it helps...
Edit:
In order to update the LINQ to SQL classes, you can either do it manually (bllurgh) or, you can remove them from the designer and drag-and-drop them from the Data Connections node in the Server Explorer.
I had to delete the entire LINQ Class, recreate it and re-add the tables for my problem to go away. Simply deleting a single table and re-adding it, or deleting all tables in the class and re-adding them did not work either.
I was having exactly the same issue, but I found that deleting the problematic tables in the Object Relational Designer and re-adding them (and re-adding the associations as well) solved the issue. I did not have to delete the entire DataContext, nor did I have to delete any of the tables that were still working properly. I would recommend trying this first before doing anything more drastic.

How do I delete records from a Datagrid as well in the database in ASP.NET using checkboxes?

How do I delete records from a DataGrid as well as the source database in ASP.NET using a checkbox to select them?
Step 1:
Lookup how to get the references to the selected items in the grid control.
Step 2:
Delete directly from the database using the references in step 1
Step 3: Refresh the grid control / page.
HTH
In the spirit of what makes this a good programming site, it behooves you to at least try to solve the problem yourself first.
Once you have had a decent go and can provide some samples of the way you have attempted to resolve your problem then the people here will be glad to help.
Simply expecting others to gift you with a solution is not really what this site is all about.
My suggestion is to go and do some research, have a go at solving this yourself and then come back and ask a question related to the specific problem you are facing when attempting to resolve this.

Resources