|
Both result sets from the stored procedure will be present in the dataset - That is why it has a collection of Tables .
|
|
|
|
|
Hi All
I am writing an app that is a time tracking systray utility but the scope has grown. The Version 1 release used a local Access DB to store Data but now management want to sync it centrally to an SQL server so group wide reports can be pulled.
In short I am looking for direction on the best way to tackle this.
SQL Sample Table
CustomerID (int) Identity = Y (i.e. Auto incrementing)
CustomerName (Text 50)
DeleteFlag (int)
RecordTimeStamp (timestamp)
MS Access
CustomerID (int) I Get the SQL ID for the record and put here)
CustomerName (Text 50)
DeleteFlag (int)
My first thought (well within the first 10) was to check the SQL timestamp and only add records that were newer that the last stored timestamp.
Thoughts
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
japel wrote: The Version 1 release used a local Access DB to store Data but now management want to sync it centrally to an SQL server so group wide reports can be pulled.
At that point why even use the Access database at all?
japel wrote: SQL Sample Table
CustomerID (int) Identity = Y (i.e. Auto incrementing)
CustomerName (Text 50)
DeleteFlag (int)
RecordTimeStamp (timestamp)
Don’t forget to add a developerID to that list, wont be long and management will want to know who’s working on which projects.
|
|
|
|
|
hi all,
i want to call the import external data window using this Microsoft.Office.Interop.Access library. does any one know this?
my application has a facility to get external data to a access database. for that i need this window to called and opened.
please help!!!!
Asanka
|
|
|
|
|
Hi All,
I am newbie for .net. I have created the simple console application and trying to create connection to SQL database.
Here is my code for console app:
<br />
#include "stdafx.h"<br />
#include "vcclr.h"<br />
#include "atlstr.h"<br />
#using "mscorlib.dll"<br />
#using "System.dll"<br />
#using "System.Data.dll"<br />
<br />
using namespace System;<br />
using namespace System::Data;<br />
using namespace System::Data::SqlClient;<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
CString hello("Hello");<br />
gcroot<SqlConnection ^> m_SqlDbConnection = gcnew SqlConnection(gcnew String(hello)); <br />
return 0;<br />
}<br />
I have the following exeption
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Format of the initialization string does not conform to specification starting at index 0.
on the string
gcroot<SqlConnection ^> m_SqlDbConnection = gcnew SqlConnection(gcnew String(hello));
Please help me to resolve the problem or point me to the article.
P.S. I found that CString defined as in the atlstr.h
typedef CStringT< TCHAR, StrTraitATL< TCHAR, ChTraitsCRT< TCHAR > > > CAtlString;<br />
typedef CAtlString CString; Maybe it helps.
-- modified at 14:32 Friday 20th April, 2007
|
|
|
|
|
It failed because the connection string you provided it, "Hello", isn't a valid description of what kind and which database you want to connect to. You might want to have a look at ConnectionStrings.com[^] for many examples of what connection strings for various databases are supposed to look like.
My C++ is really rusty, but it loks like you need to back away from the database stuff for now and start by learning the basics of CLI before you jump into the deeper end of the .NET Pool.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
We can Build our DATABASE, I just wanted to know a brief about this ,Though not to create but to have general Idea about it.
Develop2Program & Program2Develop
|
|
|
|
|
I don't understand what you mean by "Build" a database as opposed to "create" a database?
|
|
|
|
|
Ok , Sorry for ambiguity.
what I mean here is: we can develop our own datsbase same like that of MS Access
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: we can develop our own datsbase same like that of MS Access
If you want. I don't, personally, see the need as many highly skilled people who are well versed in the theory and implementation of database systems created things like MS Access, SQL Server and the like. Microsoft spends billions of dollars on creating those pieces of software and I'm sufficiently aware of my own abilities to realise that I could no where near match what they do.
|
|
|
|
|
You want to build your own database server ? Or, you want to build your own front end generator for databases from a variety of sources ?
This belongs in teh C++ section, I can't imagine doing it in any other language, and SQL and ADO are not going to help you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: This belongs in teh C++ section, I can't imagine doing it in any other language, and SQL and ADO are not going to help you.
Well, VistaDB was written in C# so it isn't impossible.
Also, when he writes his database software he'll most likely want to be able to access it in a .NET application so he's going to have to write a provider for it.
|
|
|
|
|
Colin Angus Mackay wrote: Well, VistaDB was written in C# so it isn't impossible.
No, but probably stupid, if he wants it to perform and scale as well as Access or SS ( not that they scale as well as each other )
Colin Angus Mackay wrote: Also, when he writes his database software he'll most likely want to be able to access it in a .NET application so he's going to have to write a provider for it.
That's what C++/CLI is for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes building such things is work of master's,but everything is Build upon simple basic laws,I only want that basic Idea behind it. how its Build.
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: I only want that basic Idea behind it. how its Build.
Well, if you just want to know how it is done, why not look at the source for some open source databases. Do a search for SQLite or MySQL. If you want to be more esoteric and go for an object oriented database then search for db4o.
|
|
|
|
|
Thanks a lot.So I get to see the source behind of mysql.
Please do guide me how can I get to see the source behind of Mysql
[any URL's]
Thanks a bunch to Christian and Colin
Have a wonderful weekend.
Navneet Hegde
India
Develop2Program & Program2Develop
|
|
|
|
|
Navneet Hegde wrote: Please do guide me how can I get to see the source behind of Mysql
[any URL's]
Have you thought of doing an internet search for it: MySQL Source Code[^]
The search results above will give you links to documentation of the Source Code as well as the source code itself.
|
|
|
|
|
|
SELECT MIN(BankID) AS DBComboValue, (BankSortCode) As DBComboText, BankName, BankAddress3<br />
FROM tblBanks <br />
WHERE BankSortCode LIKE @Query<br />
AND BankActive = 1<br />
GROUP BY BankSortCode, BankName, BankAddress3<br />
ORDER BY BankSortCode ASC<br />
<br />
Return @@RowCount
I have the following code to retrieve a count of rows in a result set. It works but I don't want the result set to be returned. All I want is the RowCount. My original approach was to use COUNT in the main query but I couldn't seem to get this working due to the grouping I perform. Therefore I decided to use @@RowCount and hence my current problem.
Thanks in advance.
|
|
|
|
|
Remove all the items from the SELECT list and replace with COUNT(*) . Remove the ORDER BY clause.
If the grouping causes a problem, do it as a subquery
SELECT COUNT(*) FROM (SELECT ... )
You can then access the value using ExecuteScalar from your application.
|
|
|
|
|
<br />
SELECT COUNT(*) FROM (SELECT MIN(BankID) AS DBComboValue, (BankSortCode) As DBComboText, BankName, BankAddress3<br />
FROM tblBanks <br />
WHERE BankSortCode LIKE @Query<br />
AND BankActive = 1<br />
GROUP BY BankSortCode, BankName, BankAddress3)
Thanks for that Colin. I hadn't thought of the subquery approach. I tried it though and couldn't seem to get it to work. Got the following error
Incorrect syntax near the keyword 'END'.
As in the 'END' that come right after it to finish the Stored Procedure. Any ideas?
|
|
|
|
|
Hi,
Please post your whole stored procedure.....
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
set ANSI_NULLS ON<br />
set QUOTED_IDENTIFIER ON<br />
GO<br />
ALTER PROCEDURE [dbo].[DropDownCombo_Banks_Lookup_Count]<br />
-- Add the parameters for the stored procedure here<br />
@Query As nvarchar(100)<br />
AS<br />
BEGIN<br />
<br />
--SELECT Count(DISTINCT CONVERT(nvarchar(100), BankSortCode) + BankName + BankAddress3) AS RowCounter<br />
--FROM tblBanks<br />
--WHERE BankSortCode LIKE @Query<br />
--AND BankActive = 1;<br />
<br />
SELECT COUNT(*) FROM (SELECT MIN(BankID) AS DBComboValue, (BankSortCode) As DBComboText, BankName, BankAddress3<br />
FROM tblBanks <br />
WHERE BankSortCode LIKE @Query<br />
AND BankActive = 1<br />
GROUP BY BankSortCode, BankName, BankAddress3)<br />
END
|
|
|
|
|
Change the last line of your select to
GROUP BY BankSortCode, BankName, BankAddress3) A You need to assign a table alias.
|
|
|
|
|
Oh of course. Thanks for that guys. Working fine now
|
|
|
|