|
|
I have almost figured it out. Turns out it isn't the way I am inserting it that causes it to not update, for some reason it is not pulling the newly entered values in the textboxes into the code-behind to insert.
I have a function that is called on Page_Load that sets existing values to the text boxes.
But when I hit the save linkButton it uses these values from the initial Page_Load function and NOT the ones the user has entered after that.
What is going on here? I tried turning ViewState off, but didn't work.
Any ideas?
Steve
McLenithan
Is Bert Evil?
|
|
|
|
|
|
Try using parameters instead of building the string dynamically:
string sql = @"UPDATE
MYdotNET_addressbook
SET
[firstName] = @FirstName,
[lastName] = @LastName,
...
WHERE
id = @ID";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@ID", Convert.ToInt32(Request.Params["id"]);
cmd.Parameters.Add("@FirstName", firstname.Text);
cmd.Parameters.Add("@LastName", lastname.Text);
...
cmd.ExecuteNonQuery(); Also, make sure you only initialize the controls on the page is IsPostBack is false.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
|
I've got an MDB file with about 300 queries.
Is there any way to tell which of these queries is accessing a certain table. I don't fancy having to open each on to have a look.
There must be a search of some description.
thanks,
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I have never tried this but in Access 2000 there are two tables where you can probably find the information you are looking for. The MSysQueries table appears to contain the tables used in individual queries. The table names have an Attribute of 5. This table should be joind on the MSQueries table by ObjectID. Something like:
<br />
Select b.Name as QueryName, a.Name1 as TableName<br />
From MSysQueries a<br />
INNER JOIN MSysObjects<br />
ON a.ObjectID = b.ID<br />
WHERE a.Attribute = 5<br />
Hope this helps.
Jeremy Oldham
|
|
|
|
|
Thanks for that.
I've found an alternative solution which is to use the Access Documentor on the Queries. Export the results into a text file and then do a good old Find in Notepad.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Hi, all:
I have a master-detail relationship in my MS Access DB. In my WinForm application, I also created same Master-Detail relationship in my dataset. When I delete a row in my datagrid, the entries in the detail table is also deleted in the dataset due to the relationship. After an user finishs editing the data, I call daMaster.Update and then daDetail.Update. I got the DBConcurrencyException when trying to update the detail table. I think the reason is as following: when the master table is updated, it deletes the row marked with "Deleted". Since the relationship is setup in the MS Access DB, it deletes the entries in the detail table of Access DB. When the second Update is called, the record is gone and exception is thrown.
How do I fix this problem? I can not change the order of update, otherwise it will break the new entries ( must exist in the Master table first ). I guess that if I take all the relationship out in the MS Access DB, it will work fine, but I think that probably is not good thing to do.
Please help. Thanks in advance.
Dion
|
|
|
|
|
I'm currently using ADO/Access with ATL and msjet sometimes crashes on some systems. I can't reproduce the damn bug and I'm starting to consider an alternative to Access, like XML or any other solution, where I could provide my own dll and make sure every user gets the current one.
Or is there a distributable dll available for ADO/Access?
Thanks!
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
anyone?
---------------
Tired of Spam? Introducing InboxShield® for Microsoft® Outlook®
http://www.edovia.com
|
|
|
|
|
Access isn't necessarily the problem. Have you tried ADOX?
As far as databases go, a fast, easy to use, but missing features alternative is MySQL. I like it a lot except when I need transactions or stored procedures (though I believe both are on the road map). The price certainly is right.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
You might want to try MSDE[^].
Alexandre Kojevnikov
MCP (SQL2K, Win/C#)
Leuven, Belgium
|
|
|
|
|
I find the ways of managing data warehouse's(analysis server) metadata is to interop adomd in .net framework.Do you have another ways?
|
|
|
|
|
I went through some of my colleague's (who left for another project) SQL code and I encountered the following where clause (part of it, actually):
where ...
convert(varchar(25), td.CreationDate, 111) >= (getutcdate() - @NumOfDays) and
convert(varchar(25), td.CreationDate, 111) <= (getutcdate())
...
This is part of a larger where and it narrows the search to rows younger than @NumOfDays days.
The problem I see here is that the convert(varchar(25), td.CreationDate, 111) must be executed on every row in the table (Am I right here?). This query will tend to become slower each day as the table grows (and it is expected to grow a couple thousands of rows per day).
Am I right to say that this query will eventually come to a crawl or an I just smoking some bad stuff?
NOTE: td.CreationDate does not have to be converted to its date part only. The time part can stay.
Would it be right to replace it by:
td.CreationDate >= dateadd(day, -@NumOfDays, getutcdate()) and
td.CreationDate <= getutcdate()
And I even suspect that
td.CreationDate >= dateadd(day, -@NumOfDays, getutcdate())
would be sufficient since the td.CreationDate field cannot be in the future (or I am missing something here).
Tx
|
|
|
|
|
Why do you ask, you already gave the answer. To speed things further up, you can create a non-unique index on td.CreationDate. Always check the execution plan on suspicious statements, it will tell you the cost of the statement. Twiddle around till you find the cheapest, and youre as happy as a cloud. Performance differences can make up a factor between 2 and several thousand times faster.
|
|
|
|
|
Tx for your answer, I just wanted confirmation on this.
|
|
|
|
|
Is there any way that SQL server can call any application running on the same machine. I have SQL server runing on a machine. I also got another application running on the machine. I want that SQL server to call this running application. Is it possible ??
|
|
|
|
|
If I use dataadaptor to retrieve some data from database, then use fill method to put them into my dataset object instance, then is there any way to retrive the data stored in my dataset object? Thanks!
|
|
|
|
|
dataset.Tables["tablename"].Rows[1]["columnname"]
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
How to convert from sql to oledb as "Catch Exp As oledbException
If Exp.Number = 2627"
How to modify this program? Could anyone let me know to slove it program?
|
|
|
|
|
I'm a veteran web apps developer who is now interested in building more desktop-oriented apps using C#/.NET, since it provides such an elegant framework for doing so.
I'm quite experienced in using sql server in all types of web applications with all types of technologies, however, what I'm not so familiar with is using MSDE as an alternative to access in stand-alone windows apps.
What I'm looking for are some "beginners" guides on how this is done.
How do I package a sql server database into an MSDE db and then package it up with my desktop apps so they're "stand-alone" from a database server?
How do I transfer an existing sql server database into an msde db and use it separately from a database server?
I've only so far been able to find very vague examples on the web on how to do these things.
Thanks in advance!!
-v
****************************
V. Jenks
www.scientifik.com
|
|
|
|
|
emm... If you are familiar with MS SQL, then msde is not a trouble for you, except you does not have GUI interface to manage it... but the best thing is you can always use MS SQL Enterpise Manager to manage it.
knowledge is power
|
|
|
|
|
MSDE IS Sql server, just with fixed tuning optimized for about 5 users, 2GB limit on Database size, no replication publication, no OLAP, etc. and no GUI tools.
The MSDE redist will install SQL server on your clients machine. The silent install has a lot of assumed defaults (C so you may want to study how to modify the redist install scripts to customise the installation.
Aroogala wrote:
How do I package a sql server database into an MSDE db and then package it up with my desktop apps so they're "stand-alone" from a database server?
How do I transfer an existing sql server database into an msde db and use it separately from a database server?
MSDE database == SQL database (same data files...): You can create databases with SQL developer (or any other "full" edition), detach them and have your install process attach them to the new server, aternatively you could export scripts and create the client db by reading the scripts during your install (osql is included with MSDE).
Restoring a backup also works...
Some ideas are so stupid that only an intellectual could have thought of them - George Orwell
|
|
|
|
|
I am creating tables dynamically using stored procedures, and would like to use a parameter variable as the table_name identifier. The SPs are implemented in T-SQL scripts. I am currently using literal identifiers as usual, then renaming the tables via sp_rename. For example (with SET QUOTED_IDENTIFIER ON):
CREATE PROC spCreateTable (@TableName sysname)
AS
BEGIN
CREATE TABLE "_TempTableName_" (
)
EXEC sp_rename '_TempTableName_', @TableName --rename to desired name
END
GO
Does anyone know how I could use @TableName directly or indirectly in the CREATE TABLE statement?
|
|
|
|