|
Hi all,
I want to read data from an SQL server db, is it much easier to do this from VC.NET than VC++ 6?
Wondering if I should upgrade...
Cheers,
v
|
|
|
|
|
viaduct wrote:
Hi all,
I want to read data from an SQL server db, is it much easier to do this from VC.NET than VC++ 6?
Wondering if I should upgrade...
Non-managed C++ code isn't any different really. If you were writing a managed c++ app then you could use ADO.NET
In VC6, I like to use ADO. It is simple and straight-forward to use. There is even a great helper class here[^]
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I explain better:
i've developed an application uses ado.net and microsoft access database.
This application works fine on my pc and on another that has installed Microsoft Office 2003.
If i do that on another that havn't Office 2003 on it doesn't work.
Maybe i need some dlls.
Where are them and how i unclude in my project?
Where does my setup process have to install them?
|
|
|
|
|
i have created one site and want to upload it .but i do not now how to restore the database to the server.if i want to do this only by using enteprize manager .if yes i do not now how to enter the server!
i do not actually now wat say.please help me!
|
|
|
|
|
* Create a backup of the database. Find the database in the Enterprise manager, right-click it and select All Tasks-->Backup...
* Copy the backup file onto the new server
* Restore the backup of the database. Open Enterprise Manager, locate the "databases" folder and right-click. Select All Tasks-->Restore Database...
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Thank you for your reply.Colin Angus Mackay
when i work on local server i can do the method you said.but the question was when i work on the actual server. for example i can use ftp and www.root to copy the pages of the site without the database.but i do not now how to access to the start menu of the server and open the enteprize manager.and restore the database.how can i access to the enteprize manager?
Thank you for your reply!
|
|
|
|
|
rohollahabadan wrote:
but i do not now how to access to the start menu of the server and open the enteprize manager.and restore the database.how can i access to the enteprize manager?
You do not need to be on the remote server for that. You can do all this from the Enterprise Manager on your machine. You just need to register the remote server on your machine.
In the Enterpise Manage open the tree to the Console Root/Microsoft SQL Servers/SQL Server Group and right click the SQL Server Group icon. Select New SQL Server Registration. The wizard will walk you through the process of registering a new server. If your server does not appear in the list of "Available Servers" you can just type the name in to the box and press the Add button.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Anyone know how to sum as decimal in SQLCE database?
I had try using below statement:
SELECT SUM(decimal(eAmount),9,6) AS Total FROM ExpenseDetail WHERE catID = 1
It give the error that it is not regcognize by SQLCE.
Please help!! Thanks in advance.
|
|
|
|
|
I have seen the article on how to add 'all' to the report based on tables in reporting services. But my report based on olap cube. Is it possible to enable user select 'all' from parameter list? Need your help. Thank you in advance.
|
|
|
|
|
I got my beta II CD and plunged into .NET V2.0.. Okay, now after one day, I am stumped..
In the past I would build my data layer by creating an assembly and create "manager" components. I would first add a new Component to the project and then start by dropping SqlDataAdapters onto the component page. Then I would create typed datasets from those DataAdapters and build in a little code to provide the accessors to the data, usually returning typed datasets. I never would expose any SQL, DataAdapters nor DataReaders past that layer, the only things that would be returned is typed datasets.
Now, with VS.2005 .NET Beta II, I started up a simple project, added another project for the data layer into that solutions and went to add a component on which to drop my SqlDataAdpaters. I may be blind, but I cannot find a method to "add" a component to project and all the SqlDataAdapters, Readers, Connections seem to be gone from the toolbox.
I have already ran by (to me) the evil SqlDataSource control.
Curious where the SqlDataAdapters, TypedDatasets and Components have went?
What is your method for creating a data layer in VS.2005?
Rocky <><
My Blog[^]
|
|
|
|
|
Hi,
How can I enumerate SQL data sources in my domain using C#? I found MS KnowledgeBase article 310107, but I can't get the code to even compile.
Thanks,
Royce
|
|
|
|
|
Well this is more simple than you think. It's merely a SQL Query that you need to use:
select name from master..sysdatabases
Will select all the data sources from the current SQL instance. So create a SQL command, and use this as the query, and your result will be a table with datasources.
Hope this helps.
Gidon
|
|
|
|
|
Gidon,
Thanks for your help. I am a newbie to SQL (as you might have guessed), so maybe I misstated my problem. I am equating "data source" to "server", as described in the help for the SqlConnection class:
Data Source -or- Server -or- Address: The name or network address of the instance of SQL Server to which to connect.
So I want to find all of the servers on the current domain.
Royce
|
|
|
|
|
Well the truth I'm not sure.
You can maybe loop through all the computers in the domain, and try to make a sqlconnection, if it succeeds you know there is a SQL server on that computer in the domain.
I did a quick google search and found this thread about listing computers in the domain using .NET
http://www.dotnet247.com/247reference/msgs/32/161278.aspx[^]
Gidon
|
|
|
|
|
|
Using SQLDMO is by far the easiest way to do this. It is a pain to distribute though because you need to distribute half a dozen com dlls and some of them need to go into specific folders. I did one of these recently and it took me nearly a day to find the documentation on distributing DMO correctly.
Jon
|
|
|
|
|
Hi every body!
Please tell me! how can i get list of all tables in oracle database and all fields of a table?
Thanks!
xyz
|
|
|
|
|
This is the ANSI SQL way to get all tables:
select TABLE_NAME from INFORMATION_SCHEMA.TABLES
|
|
|
|
|
test
|
|
|
|
|
you can use
select * from tab
to get the list of all tables
vaibhav.
|
|
|
|
|
SELECT * FROM USER_TABLES
Free your mind...
|
|
|
|
|
i need to insert inside a column field a null value.
I'm tring with this but it doesn't works infact insert a string:
cmd.Parameters.Add("@Data_p", "Null");
what is the correct sentence?
|
|
|
|
|
try cmd.Parameters.Add("@Data_p", DBNull.Value);
|
|
|
|
|
I need to update a row of a table made by:
auto counter | string | integer
my table name is myTable and the columns are:
ID | Text | number
i use database access and c#
|
|
|
|
|
Well you can't update the autocounter, that is 1. The rest is ass follows:
UPDATE myTable SET Text = 'My new Text', number = 645
I guess you know how to make a SQLconnection and sqlcommand in C#. And in this case you can use the ExecuteNonQuery() method of the SqlCommand, because this update doesn't return any values.
Btw. it is best practice to but this query inside a stored procedure (for security + performance reasons).
Gidon
|
|
|
|