|
|
|
Is it possible create table WITH MY PROGRAM useing ADO.NET?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Yes
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
Yes, the easiest way is to issue a "CREATE TABLE ..." command
Dave.
|
|
|
|
|
dougieb wrote:
An extra $20 if you add parameters for 'first record to return from set', 'how many to return from set'
Save your $20 bucks and put a SELECT TOP X, where X is the record #.
No one will be able to give you a working solution without the tables. All you'll get is untested queries, and probably none will work and all of them will be slow.
Or, if you want, buy me a Amazon certificate.
Q261186 - Computer Randomly Plays Classical Music
|
|
|
|
|
I had a correct answer, so I tried to delete the thread as not to bug anyone else, but to no avail.
Thank you.
|
|
|
|
|
dougieb wrote:
As for the absence of tables, I'm pretty sure that generic tables could be made for testing purposes, or I figured that there would be some puzzle enthusiast who would just redo the syntax.
All I can say is good luck
Q261186 - Computer Randomly Plays Classical Music
|
|
|
|
|
I guess for a guy who's going to earn $60 it will be quite helpful to know data layout (tables, columns, column types, indices). Or do you think $60 should cover all guessing work too?
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
This is my first run with SQL Server 2000. I have the server setup on my network, but when I go to "Register New Server" within Enterprise Agent, it's not listed. It's listed in the Win2k ODBC Admin tools (where you setup DSN's), but not within Enterprise Agent. There is a server showing up, but it is not mine. There are about 30 or so SQL server's out there (which, again, are listed where you setup ODBC in Win2K), but only one of these are showing up with I go to register a new server. What are some of the possible problems? I have verified protocol setup of TCP/IP for both server and client. Any help is appreciated!
|
|
|
|
|
I have seen this several times. Sometimes you jst have to type in the name of the server.
|
|
|
|
|
Is it possible to get a reference (pointer) to the actual data stored in a recordset, rather than a local copy? All the functions we have found return data by value. However, we want the fastest mechanism for getting at large volumes of data and so don't want to perform copies every time an item is accessed.
Thanks in advance!
Visit my website![^]
|
|
|
|
|
Connected recordset is the closest thing to actual data you can get. So if you have ADO Recordset object (not disconnected), you can call Update method to modify data. There is no way you can get a pointer to physical data. If you OLE DB directly (bypassing ADO), you can retrieve and modify data in a more efficient way.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
Thanks for your help, Vagif. It's a shame you can't get a pointer to the physical data. Nevermind. I guess your sig could say: ADO is for sissies. Real men use OLE DB. And the most hardcore types use only db library!!!
Cheers!
Visit my website![^]
|
|
|
|
|
I hope someone can help with this problem I am having...
In our application, we have a situation where a grid is populating itself from a simple SQL SELECT statement. The grid must update in real time when data in the database is changed. Data in the database may be changed by any user sitting at any workstation.
My question is: Is it possible to receive a recordset event when data is changed in the database, given that the data may be changed by another user with a different connection?
All the documentation we have found indicates that events are fired when an application changes data in the recordset, rather than the underlying data in the database being changed. Is this correct?
Many thanks in advance!
Visit my website![^]
|
|
|
|
|
Hi,
i have following problem, i have application which is linked with
ddao35.lib (ddao35.dll) (change table properties, like validation rule)this was org. built for a access 97 database.
now i like to update my application for usage access 2000 together with access 97
so with SP 5 for visual studio 6.0 a project (ddao.cpp) was shipped, new dll ddao36.lib (ddao36.dll) could be built
now i linked my application with ddao36.lib and everything goes well for a
access 2000 database, but for access97 database is code still running but
after opening the database in access i see that some modifications are not done
a function like this, won't work for access 97 (running without errors)
void ChangeTableValidation(CString strDBFileName, CString strTableName, CString strFieldName, CString strValidation)
{
CdbDBEngine dbEngine;
CdbDatabase dbDatabase = dbEngine.OpenDatabase(strDBFileName, FALSE);
CdbTableDef dbTableDef = dbDatabase[strTableName];
CdbField dbField = dbTableDef[strFieldName];
dbField.SetValidationRule(strValidation);
}
perhaps has somebody any idea about this,
DanielO
|
|
|
|
|
Hi!
What do I need to re-distribute if I have written an App which uses SQL server? Is the desktop engine enough? How does it work then? I distribute that thing, install it and then run my scripts through isql (osql) in order to install my dbobjects? Does anyone know where to get information on this topic? Searched MSDN but can't find anything...
Any help is greatly appreceated!
A ton of thanx.
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
|
Thanks a lot. Have to read it afterworx though
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
Please need a solution asap
thanks
I have generated IDs in SQL Server 2000: Data Type = Int, size = 4, seed =1 , seed increment by = 1, precision is 10 digits, scale = 0 digits.
Now i need to format it in 10 digits like if id is 1 then it should be stored and generated in sql server in 10 digits like 0000000001 or 0000000555
----------------------------------
Another problem : in uploading db to sql server 2000 with hosting company. On my machine its working fine with sql server 2000 locally but with the below instructions to upload i cannot connect.
The Server IP address is: 128.121.4.12
You will need to setup an alias in your SQL Server Client Network Utility,
You can name the alias "SQL2K1". Set it to use TCP/IP on port 1433. You can
then set up the new registration in Enterprise Manager. The server name
would be "SQL2K1". The username and password would be the the username and
password you gave when you requested your sql database.
If you have a problem with not being able to connect to the sql server,
you need to verify that you are not behind a firewall, or that your ISP
is not blocking ports 137-139, and 1433. You might also try increasing
the default timeout to 30 seconds. You can find this setting by going to
tools then options, and clicking on the advanced tab.
|
|
|
|
|
Madhusudan wrote:
I have generated IDs in SQL Server 2000: Data Type = Int, size = 4, seed =1 , seed increment by = 1, precision is 10 digits, scale = 0 digits.
Now i need to format it in 10 digits like if id is 1 then it should be stored and generated in sql server in 10 digits like 0000000001 or 0000000555
Not sure I understand the problem. Since you selected int as column type, it will be stored as integer - so if you store value "1", it will be retrieved as "1". Data storage has nothing to do with formatting, you can reformat values using either T-SQL string processing functions - so your program will formatted values, or (which is better, I think) let your program format data when it displays them.
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
Hi Folks
Re: ADO.NET : SqlDataReader : I need to assign retrieved value to C++ variable
I have found the source of the problem expressed in the thread "ADO.NET : SqlDataReader : I need to assign retrieved value to C++ variable":
http://www.codeproject.com/script/comments/forums.asp?forumid=3785#xx309754xx
but do not yet know why it occurs or how I can fix it.
The problem arises with the /clr compiler setting.
Here is the code to illustrate this:
/////////////////////////////////////////////////////////
#include <stdafx.h>
#include <cstdlib>
#include "try_ADONET.h"
//#using <mscorlib.dll>
//#using <system.dll>
//#using <system.data.dll> // This is required for the ADO.NET Provider
using namespace std;
//using namespace System;
int Main()
{
CString busNumberSQL[2];
CString bus = "Hello";
busNumberSQL[1] = bus;
return 0;
}
////////////////////////////////////////////////////////
Without the /clr setting the array of CString busNumberSQL[2] is correctly contructed as is CString bus and the line
busNumberSQL[1] = bus;
works as expected. This can be seen by putting a breakpoint in at
return 0;
and seeing the variables in a Watch. Copy the expanded Watch details (Name, Value & Type) to an EXCEL sheet.
..................
Next, add the compiler switch /clr and rerun the code.
CString bus is constructed correctly BUT something weird happens in the construction of CString busNumberSQL[2].
Now,
busNumberSQL[1] = bus;
results in the address of bus as an integer being assigned to busNumberSQL[1], and look at the Watch details!!
Copy the expanded Watch details (Name, Value & Type) to an EXCEL sheet
Name: busNumberSQL; Value: {Length=2}; Type: ATL::CStringT<char,strtraitmfc<char,atl::chtraitscrt<char> > >[] ...(Note no dimension at end compared to the "no /clr" case.
Next Watch line: [0] 2083454756 __int32
Next Watch line: [1] 3103464 __int32
My conclusion is that busNumberSQL[2] is not an array of CString.
Of course, I need the /clr in order to use ADO.NET!
It seems as though a CString works, but a CString array for some (unknown) cannot even be defined.
Do you have any light for me? (I have not got into your previous post yet on Marshall)
Best regards
Doug.
(In case you are wondering I am very much a beginner with C++ and .NET)
Doug
|
|
|
|
|
Hmmm...
After reading your question I read this[^] article. It looks like you are going to need to use System::String.
System::String* busNumberSQL[2];
System::String* bus = S"Hello";
busNumberSQL[1] = bus;
Does this help?
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Thanks Nick
using String* exclusively is an option I can adopt.
regards
Doug
Doug
|
|
|
|
|
Doug wrote:
using String* exclusively is an option I can adopt.
You don't have to strictly use String*, you can for example do something like this:
<code>String* SomeString = S"ThisWillWork";</code>
<code>char* szSomeString = (char*)Marshal::StringToGlobalAnsi(SomeString);</code>
<font color="green">
<code>Marshal::FreeHGlobal((int)szSomeString);</code>
HTH
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|