|
Brilliant! Exactely what I needed to get the right results back.
Thank you
|
|
|
|
|
Hi,
I currently have a stored procedure which is able to delete a record of my choice..
Instead of having the RECORD deleted, I would like the RECORD to disappear from the Datagrid, and have a boolean value of the 'Deleted' Field in that RECORD be set to 1...
Is this implemented in the Stored Procedure? Any ideas would be appreciated..
|
|
|
|
|
This is a very common approach. There should be no problems implementing this into a stored procedure (except you will have to remove the item from the datagrid in the code).
Mike Lasseter
|
|
|
|
|
Thanks for the reply. Appreciate it. I'll go figure it out.
Take care.
|
|
|
|
|
I would Imagine that you are populating your Datagrid in a method. If you do not have a separate method for this I would highly recommend it. When the user activates the UI control to delete the record from the datagrid I would also call the method that populates your datagrid. If you call this method after you delete the DB record your Datagrid will automatically re-populate with out the record.
Hope this helps.
|
|
|
|
|
I have the below query but would like to use a wild card value to do the search.
I need to pass a value like "on" and find, Jason or Preston. It would be nick if it is also not case sensitive....
This value is coming from VB.Net App and this is messing with me...
My Access (SQL) statement is:
SELECT *
FROM MainTB
WHERE myCustomer Like [@myVar];
But the LIKE needs to be [%myVar%] I think.
Feedback welcome please......
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
SELECT *<br />
FROM MainTB<br />
WHERE myCustomer Like ('%myVar%');
|
|
|
|
|
Running this query from access it does not ask me for an input it is looking for a user of %myVar%
As it is in the ' ' string quotes... I have already found this and tryed it...
Any other thoughts.....
?
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
The string concatenation character might help
select *
from MainTB
where upper(myCustomer) like '%'|upper(@myVar)|'%' This will also make it case insensitive.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
The following error is occuring while attempting to connect to sql server the connection string is as follows:
"conn = new SqlConnection("Password=786;data source=DBSERVER;initial catalog=Venture;persist security info=False;user id=sa;workstation id=Venture;packet size=4096");"
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
|
|
|
|
|
I've seen this error occur when SQL Server is not running. Not sure that is your problem, but it is something to eliminate.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
|
|
|
|
|
It could be exactly what it says. There is a configuration tool for SQL 2005 that will let you check this. Check the server protocols. There will be a short list something like this:
Shared Memory Enabled
Named Pipes Disabled
TCPIP Enabled
VIA Disabled
If you right-click on TCPIP and select properties you might be as surprised as me to find this:
IP1
Active Yes
Enabled No
Address 192.168.1.1
...
IP2
Active Yes
Enabled No
Address 127.0.0.1
...
Apparently SQL server comes with most things turned off. Try setting the Enabled(s) to yes and see if your problem changes. I was not using the TCPIP, so could not test it. Please post back if this made a difference.
>>>-----> MikeO
|
|
|
|
|
Thanx!!
It is now working fine.
I just enabled the named pipe, after that it is working.
|
|
|
|
|
Hey all,
Is there a way to know when table changed and who changed it?
is there a default table that logs those kinds of changes in MSSQL 2000?
Thanks
RoyRose.
|
|
|
|
|
Nope, unless you've enabled it. Article here talks about it.[^]
If it's just one table, then you can implement it yourself using triggers etc...
Googling for "sql server audit trigger" provides a load of methods.
ChrisB
|
|
|
|
|
Hi friends,
Please give me solution for the following queries.
1) How to find 6th highest salary from Employee table
2) How to select duplicate rows in a table
Thanks in advance.
Thanks and Best Regards,
R. Sangeetha Priya
Prya
|
|
|
|
|
1)In SQL Server:
select top 1 * from (select top 6 * from employee order by salary desc) as s order by salary asc 2)There are a few ways, but I like this one:
select * from (select count(*) as Duplicates, * from Employee group by name,salary) as tbl where Duplicates > 1 (but you have to have every field in the group by clause)
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I had a Question I was hoping you might be able to help me with.
I am using VB.NET 2005 express and I have a list box that is bound to a table in a dataset. I want to be able to select one of the items in the list box and then use an item that corresponds to this item in the list box and I do not know how to do this.
For example, if I had a table named Person and this table had two fields one named PersonID (which is the key field), PersonName, and PersonAge. Say I had PersonName bound to the list box. So say I click on one of the PersonNames in the list box and then wanted to use the PersonAge, which corresponded to the name I had clicked, in a calculation. How would I access the PersonAge value?
I appreciate any help you could give me.
Thanks,
|
|
|
|
|
Check this example
http://www.thescripts.com/forum/threadnav348524-2-10.html
|
|
|
|
|
hey all!
i was wondering can any 1 give me a code sample in c++(if possible dono if is or not) for connecting to a data base. i have used hem before in php but have no idea how to do it in c++
thanx, jt
|
|
|
|
|
This is a very open question...
What type of database???
If you just need the connection string check our http://www.connectionstrings.com
Also do you want to perform inline SQL / Procedures or use the VS ADO database objects...
Not much help but not much to go on...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Hi, please help
I wanna select top 5 from table satisfying a condition
and at the same time count the number of rows returned based on selection.
Select top 5 LastName, (Select count (*) from TBL where lastname = 'Cruz') as Count from TBL where lastname = 'Cruz'
assuming there are only 3 rows with Cruz as latname
result should be:
Lastname | Count
Cruz 3
Cruz 3
Cruz 3
I mean my query doesn't work and have researched over the internet.
Please help. thank you.
Gerri
|
|
|
|
|
Select top 5 LastName, count (*) as [Count] from TBL where lastname = 'Cruz'<br />
group by lastname order by [Count] Desc
|
|
|
|
|
it doesn't work, seriously. I already copy pasted and been doing some workarounds on this. using sql 2005. or what's wrong really?
thank u
Gerri
|
|
|
|
|
Select top 5 LastName, count (*) as [Count] from TBL where lastname = 'Cruz'<br />
group by [Count]
|
|
|
|