|
OK, I've uninstalled SQL 7 and installed MSDE SP3a. I'll try your suggestions when I get home. One problem is, I've deleted all entries of MSSQL in the registry but when I try to run the SQL Server Service Manager, there's a blank entry above the MANUELJR entry in the Server combo box, is this right? What's that blank entry? Does that mean that I've missed or did not properly removed SQL 7? Please help.
|
|
|
|
|
Can you tell me what is windows you are using? (w2k, xp...) answer clearly about its version (if win2k tell me, server or pro.)
On the other hand, check on wrox website. They also have an errata site for user to post any question or any error on it to update to the correct one.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I'm using Windows XP Pro, almost all of old Wrox titles are in APRESS now, I've downloaded the sample files. There's no errata, even though I've found several errors in the book already. Forums on previous Wrox books in APRESS are not well organized, all questions regarding them are just in one forum topic, so it's very difficult to find out if anyone is having a question about my book.
|
|
|
|
|
I am desperately trying to make a connection to an MS Project 2000 (or 2003)in order to extract some well defined data and to make some work on them and to put the results in SQL Server 2000. However I can't find the connection string in order to connect to MS Project.
Lastly I found the following OleDbConnection object :
' ... OleDbConnection conData = new OleDbConnection("Provider=Microsoft.Project.OLEDB.11.0; PROJECT NAME=h:/Plan Projet POC-Review1.mpp"); ... '
However it doesn't work.
More. Before connecting to MS Project, has the .mpp file to be "saved as type: Project Database" in the "save as" box which produces an .mpd file, before trying to connect.
I know I could handle the problem through the use of a DTS package but for some reason I have to do it through the use of ADO.NET and C#.
Please could somebody help me before getting grey hair (I already got some)
and
Frank
|
|
|
|
|
I have some questions regarding SQL select command, but first let me explain my condition first.
I am a newbie in C# and SQL, and developing some window application with database connected from SQL Server.
And the questions I have is when the select command only want to retreive some portions of data (one or two rows from hundreds of row from the same table).
I know there are two type or methods of having the select command: stored procedure and non-stored procedure.
For the stored procedure, the query is processed in the SQL Server, and return the result to the workstation.
But for non-stored procedure select command, is it doing the same thing? or the query return all row of data to the workstation, and then the workstation process it after receive all the data?
Since I have concern that my network will be overloaded if all the data are being transfered only to take one or some rows of data.
Thank you very much in advance.
|
|
|
|
|
With an ad-hoc query (a query passed to the server, instead of using a stored proc) the SQL Server will still honor the where clause and only return the rows you want to the application.
There are a couple of advantages to stored procs over ad-hoc queries:
- ad-hoc queries have to be compiled every time you perform the query. Stored procedures are compiled, then the compiled version is re-used for some time, and re-evaluated/re-compiled only occasionally. This is a major benefit in high-volume systems.
- depending on the app, sometimes it's possible to tweak performance and/or operation of an application with modifications to the stored procedure, without having to recompile the entire application to implement the change.
- depending on the complexity of the query, sometimes it's simply easier to read the code when the SQL code is completely isolated from the C#/VB code, instead of the two being mixed together in the application.
There are more benefits to procs, of course. And there are some benefits that ad-hoc queries have over procedures (although IMHO few and far between.) But I much prefer using procs. Mainly for the reasons listed above.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
ADO.NET (your SqlDataAdapter , etc) is a disconnected system. Meaning, all the data is held and manipulate on the client. (Someone correct me if I am wrong here...) So, no matter how you structure your query, all the data goes to the client when you call the Fill method on your SqlDataAdapter .
If you are concerned about swamping your connection, I suggest you write a more restrictive query, so that it only returns the rows you actually need. If you cannot tighten up the logic, you can try something like:
<br />
select top 2 column1,column2, etc<br />
from YourTable<br />
Hope this helps,
Bill
|
|
|
|
|
Thank you very much for the reply.
I guess from the reply, I understand it much more than before, and I think I am in the right path.
In most of my query, I used ADO.NET, but restricted the select command to the columns and rows that I am interested in by using WHERE clause.
My concern was, the network load of the select command.
I was afraid that the ADO.NET select command retreive all the data and rows even I only selected one column or row. And then the client applied filter to the retreived data to get the data I wanted.
But I guess I'm wrong.
Again, thank you so much for the reply. It gives me very much information and knowledge about SQL.
|
|
|
|
|
SqlServer does the "selecting" so only the results of the query travel from the server to your client application.
Bill
|
|
|
|
|
Yes, I understand it now.
Thank you very much for the reply.
|
|
|
|
|
Antonius_r3 wrote:
My concern was, the network load of the select command.
I was afraid that the ADO.NET select command retreive all the data and rows even I only selected one column or row. And then the client applied filter to the retreived data to get the data I wanted.
But I guess I'm wrong.
Just as a clarification: It is SQL Server that is lowering your network traffic not ADO.Net. If you sent the same query to a remote MSAccess MDB database (via ADO.Net) you would experience a much heavier network hit since the filtering would happen on the client.
|
|
|
|
|
Hi, I'm using ODBC to query a database that can be selected by the user at runtime. This query "SELECT * FROM MSysObjects WHERE Type = 1 AND NOT Name LIKE 'MSys%'" will return a list of table names fine, but unfortunately, persmissions on the ACCESS DB must be set to ADMIN for this query to succeed. Is there another way to get table names from a DB without having to first alter persmissions? or is there a programatic way to alter permissions?
Thanks.
"Ergo huffabo et puffabo et tuam domum inflabo" ait magnus malus lupus.
"Non per comam men-men-menti!" ait porcellus.
|
|
|
|
|
Hi, I seemed to have solved it using SQLTables() function....Thanks anyway.
"Ergo huffabo et puffabo et tuam domum inflabo" ait magnus malus lupus.
"Non per comam men-men-menti!" ait porcellus.
|
|
|
|
|
Getting now "Unable to load odbcji32.dll" message box.
Even in "Data Sources (ODBC)" can't configure MS Access DB anymore. What's up?
Thanks for ideas in advance!
|
|
|
|
|
currently I use the following pseudocode for updating
AddNew(...);
SetFieldValues(Field, Value);
Update(...);
Now I'm updating a LOT of data whereas it takes about 1 minute to finish an update of the database. Is this not untypical for database updates that affect 1000's of records or are their ways to optimize updates of this nature so the user isn't stuck waiting for so long?
thanks!
|
|
|
|
|
That is probably the slowest method of updating data. Other options are:
* Place all inserts inside a single transaction -- will give some speed improvement
* Use SQL insert commands instead, using a precompiled command with parameters. This is very efficient and my recommended choice.
* Use a bulk upload tool, such as BCP, or SQL DTS packages
.NET 2.0 will include better bulk data support, but until then you are stuck with the above options.
my blog
|
|
|
|
|
wot is the latest service pack or update for sql server 2000.
|
|
|
|
|
Check This[^] it might be the final one.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I'm wondering what others do when they are updating records in a database. In the application I have I am deleting all records and adding a fresh set. I do this simply because either 1 record to all records could be effected and to keep track of effected records means more code. However is it worth to code an object to keep track of changes or is it simply easier to erase and rebuild?
simply curious.
|
|
|
|
|
Well usually data is linked in some way to other data, and in that case it makes sense to go to the trouble of updating existing records.
If your data lives on its own, with no other data that links to it, then I see no problem with what you are doing.
my blog
|
|
|
|
|
How do I find the column (index) number at runtime of a particular DataGrid column if I know the column header string
//somthing like the following
int x = datagrid.column["ID"];
|
|
|
|
|
This question would be better asked in either c# or asp.net forum...it really has nothing to do with sql or ADO.
How about this (untested):
<br />
int x;<br />
bool bFoundIt=false;<br />
for(int i=0;i<datagrid.Columns.Count && !bFoundIt;i++){<br />
<br />
if (datagrid.Columns[i].HeaderText == "ID"){<br />
x=i;<br />
bFound=true;<br />
}<br />
}<br />
Seems like the kind of thing you could do in a more OO way too...like override the Columns collection...but I won't suggest it without trying it myself first.
Hope this helps,
Bill
|
|
|
|
|
Is there something I can use w/ ADO.NET/Access to determine the value of a primary key on a row that was just inserted? I do this all the time w/ SQL using @@Identity and an output parameter, just wondering if it was possible in Access.
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Hi there. Here's a link[^] to another forum thread that shows an example of doing the same thing - Select @@Identity - in Microsoft Access. This should help you.
|
|
|
|
|
Hi,
I'd like to write a stored proc, which will acomplish the following: I have a users table. I want to update a record with a given ID. Bevor updating the record, I'd like to check whether the DateModified Field of the record equals the @DateModified Parameter, which should be passed to the procedure. Here is what I came up with. I'm actually lacking any experiences with SP's. Here goes:
<br />
CREATE PROCEDURE updateUsers<br />
@ID int, <br />
@Name varchar(50),<br />
@DateModified datetime<br />
AS<br />
<br />
-- compare the datemodified<br />
DECLARE @LastDateModified datetime<br />
SET @LastDateModified = SELECT [Users.DateModified] FROM [Users] WHERE [Users.ID] = @ID<br />
<br />
IF (@LastDateModified <> @DateModified)<br />
BEGIN<br />
RETURN 1<br />
END<br />
ELSE<br />
BEGIN<br />
UPDATE [Users]<br />
SET<br />
Name = @Name,<br />
DateModified = GETDATE()<br />
WHERE<br />
ID = @ID<br />
GO<br />
<br />
RETURN 0<br />
END<br />
<br />
Can anybody help?
Thanks in advance,
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|