|
in the button click event just write an update query!
you can simply have update tablename set q_sold=q_sold+1, Q_hold=Q_hold -1 where itemtype = item the user selected at the front end
Gautham
|
|
|
|
|
Thanks for the replu.
I built the query and it seems to work fne when I execute it in the querybuilder.
My question now is when I use the query in the btnclick event, how do I reference the specific items I want changed?(IE the Paintballs500 row)
Again thanks for the help
Jon Henry
|
|
|
|
|
Hi , Please do suggest if it is possible to start sql server with start method,without using sql manager fron desktop ,and also close it
Develop2Program & Program2Develop
|
|
|
|
|
Start SQL:
net start mssqlserver
Stop SQL:
net stop mssqlserver
Wout Louwers
|
|
|
|
|
will it work in vbscript
Develop2Program & Program2Develop
|
|
|
|
|
Yes, you can do this in vbscript. Just google for wmi start stop service. There are a lot of examples.
Wout Louwers
|
|
|
|
|
I'm using SQL Server Express, and I've seen the option to provide a SA password, instead of using the default windows authentication. But doesn't this only deal with the server portion. What I'm concerned about is password protecting, maybe encrypting, the MDF file itself, in the event that the file is stolen off the server. If there is any easy was to do this, any help and points in the right direction would be greatly appreciated.
A soft glow comes from the pit in the darkness.
The clicking noise become faster - and louder.
A wind begins to stir up from the pit, as the
creature flexes it's wings, preparing for flight.
You stare into the pit, and hear a voice say
in your mind, "If you survive the encounter,
declare it to the world."
The Code Demon Rises.
|
|
|
|
|
IIRC, change the sa password to something other than the default, then there isn't any good stealing the .mdf file...
|
|
|
|
|
I am writing an update statement an executing it with an ExecuteNonQuery();
I am updating customer names (first and last concatenated) but I seem to be
having trouble with names like Sally O'Hara. The single quote I believe is the
problem because names without it update just fine. I tried to use the ascii value
but that puts 2 single quotes in the data base. I could use some help generating
the customer name string.
Sample code
"UPDATE Appointments SET Customer_Name" + " = '" + customername + "'" + " WHERE AppDate = " + "'" + lappt_date + "'";
Any help would be appreciated.
Thanks for the Help
NewTuCsharp
|
|
|
|
|
It is better to use stored procedures that accept the arguments
and update them in the table.
Regards,
Arun Kumar.A
|
|
|
|
|
You should either use stored procedures or parameterized queries. Both not only avoid problems like this, but also protect against sql injection attacks. See Colin Mackay's excellent article[^] on this subject for further info.
|
|
|
|
|
Rob Graham wrote: protect against sql injection attacks. See Colin Mackay's excellent article[^] on this subject for further info
Darn you beat me to it :->
|
|
|
|
|
I tried to run a DTA Scalar value that returned SCOPE_IDENTITY, and cast it to an Int. However it fell over with an invalid cast exception, on closer inspection, it returned a Decimal.
I looked up on google the solution was to cast the identity as an int in the SQL as follows:
SELECT CAST(SCOPE_IDENTITY() AS INT)
This however simply returns "1" all the time. (Previously the Decimal was the correct value)
Could anyone shed any light on this?
Cheers
Tristan
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Damn DataAdapters reset the Scalar / Non Query flag when you edit the command text.
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
how to store msword file in sql table please help me
raghun
|
|
|
|
|
If it is SQL Server 2000 then in an image column. If it is SQL Server 2005 in a varbinary(max) column.
|
|
|
|
|
You can use blob type for storing files in sql table
|
|
|
|
|
I am trying to create a table containing a varbinary(max) data type. The max key-word is specified in BOL but it also indicates I should done a sp_tableoption with one of the parameter values "large value types out of row".
This is not working as the value does not exists.
I will appreciate some guidence on how to enable this data type.
|
|
|
|
|
varbinary(max) is new in SQL Server 2005. If your server is older (SQL Server 7.0 or 2000) the nearest equivalent is the image data type.
To check what version the server is, run the query SELECT @@VERSION . SQL Server 2000 is version 8.0, SQL Server 2005 is 9.0.
|
|
|
|
|
is it possable to sync two SQL express servers nightly? I only need to sync one database.
my first thought that might work in my situation is writing a program that shuts down SQL then copies the database to remote location that only needs read access to the data then starting SQL services again.
three things i don't really like, the fact that the remote users could not change the data in the case that they need too and would require a catch if one of the servers were down. if there is a supported way to achive this i would rather do that.
|
|
|
|
|
I doubt what you want is possible with the Express edition. You are asking for functionality that is normally required by a business or enterprise.
|
|
|
|
|
I understand that but it does not make sense to spend 10K on something that only 4 users use there is no ROI on that. I know I can write vb script that would do waht I described above but that could open up other issues. and does not support my goal of having the database editable, even though it is not a requirement.
|
|
|
|
|
Planker wrote: it does not make sense to spend 10K on something that only 4 users use there is no ROI on that
Hear you on that.
Planker wrote: my first thought that might work in my situation is writing a program that shuts down SQL then copies
Writing a program to sync both of them wouldn't be that hard, and shutting down SQL wouldn't be necessary...
|
|
|
|
|
Planker wrote: is it possable to sync two SQL express servers nightly? I only need to sync one database.
Huh? Why?
"We are all repositories for genetically-encoded information that we're all spreading back and forth amongst each other, all the time. We're just lousy with information."
- Neal Stephenson
|
|
|
|
|
I have an application that I feel is poorly written, The business edition uses their database format that is not SQL that I need to run either across a WAN(NOT POSSIBLE - they load most of the database when the program opens, takes 5 - 10 mins for the program to open, the users are to stupid not to click on the program again causing it to run even slower, and eat bandwidth on my WAN) or have some sort of replication between the two sites. the Vendor told me to buy their enterprise version and I could run it on SQL express to do the job. from what I know and everything I have read SQL Express does not support replication. So at this point my solution is to get the Enterprise version and do a nightly copy of the data across the WAN, the users at the remote site more or less just need to be able to review the data to make sure someone is doing their job. I feel this is not a complete solution and would like to find a way to replicate the data with out spending 10K on SQL Server so two users have full access to this data.
If anyone has any suggestions I am all ears.
|
|
|
|