|
A non-clever method is to use temp table instead of a single sql script. :p
|
|
|
|
|
|
by using sql server agent we backup the database as we required.in the same way can i send an email.
what my requirement is , to send mails to relevent parties when the complaints are not handled within 24 hrs , they are lodged.
to send the email i should specify the mail server,but what if i'm not having a mail server and using a free mail server in the internet,how to configure the database mail..
-- modified at 0:15 Wednesday 12th September, 2007
|
|
|
|
|
if you are using 2005 then it has built in email.
If you are using SQL2000 install CDONTS and look for articles on google on how to use it,
|
|
|
|
|
I want to filter my data while im typing the word that i want to search on a textbox.tnx
Sunshine
|
|
|
|
|
Where is your data coming from ? It seems pretty straightforward to me, if you're using a database and want to filter from the DB. Just build a query on each keypress to return the data valid for that search.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes im using a database and the search result would appear to the gridview...im having a combobox that would give the textbox choices on which to filter...but i dont know how to use the like clause in the select statement propely..
sql = "Select Supplier_Information.Supplier_ID,Supplier_Information.Supplier_Name,Supplier_Information.Address,Supplier_Information.Contact_No, Products.Product_ID, Products.Product_Name,Products.Product_Type, Products.Present_Price, Products.Past_Price from Supplier_Information, Products where Supplier_Information.Supplier_ID like '%s-%' "
i have this code but it does not work properly...i want to come up with a textbox that would filter in every letter that they will type in the textbox.tnx
|
|
|
|
|
Whoah - this is a really bad design. Don't attempt to do this because you are going to be hitting the database after every keypress. The more users you have, the more you are going to hit the database. How would you handle the case where the user enters some text and then starts to delete text? Thats the same data being queried many times.
Please - rethink your design.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
any suggestive design that i could make?may i know exacly what is the bad design that you are pertaining of...tnx
|
|
|
|
|
I'm sorry, but I thought I'd made myself clear enough. Don't design a system where you are hitting the database so many times. Apart from anything else, you probably won't be able to retrieve the data and display it quickly enough if the user is a quick typist.
As for the design - identify a more natural point for retrieving the data.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
should i delete my combobox?or can i search any data on my database in my textbox without giving any choices for filtering
|
|
|
|
|
This has stopped being a question about databases and become a question about an autofiltering combo box. The exact details of how to do this depends on whether you are using Win Forms or ASP.NET.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i using vb.net...actually i really want to know about filtering...hos to use the like clause for searching
|
|
|
|
|
shyne7 wrote: i using vb.net
VB.NET is a language. The question was about frameworks. Which framework are you using? The ASP.NET framework or the WinForms framework (both of which are part of the larger .NET Framework)
shyne7 wrote: hos to use the like clause for searching
WHERE SomeColumn LIKE '%'+@SomeSearchTerm+'%'
@SomeSearchTerm is passes as a parameter for security
|
|
|
|
|
u want to filter
so ,
u are writing the query. ok then in where clause
fieldname like '" & textbox1.text & "%'
u will get the result
|
|
|
|
|
tnx...that helps...but i have two tables in one gridview...how could i view those in my gridview when i search for a data that is only in one of the tables
|
|
|
|
|
rohitsrivastava wrote: fieldname like '" & textbox1.text & "%'
NO NO NO NO!!!! Do NOT inject into SQL strings like this. I've been banging on about this for THREE years now! Doesn't anyone know about SQL Injection Attacks?!
SQL Injection Attacks and Tips on How to Prevent Them[^]
|
|
|
|
|
Ah well - at least I did mention parameterized queries (albeit in another post) . Don't worry Colin - some of the more professional members of the site have read/taken in your message. Perhaps your technical test should include a query that's wide open for Sql Injection and then ask candidates if they can tell you what's wrong with it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
We believe we know the interval when multiple records are being entered when they shouldn't be (we don't know why yet, vendor to figure that out). The interval is something like 00:00:45 or so. Using managerial fuzzy logic, I can get better than superbly screwed up data by grouping the records by timestamp. This really seems like it lends itself to a cursor operation to first indicate whether the sorted records are in the proper date range, then we go by time and place a value into a new field to help us sort based on some fine subtraction caluculation. All in a job to automate it.
Anyone have a better suggestion? I'm pretty good with cursors and once it's run once, I can ignore existing rows to reduce the operation. It just seems so clumsy.
Thanks in advance,
i
|
|
|
|
|
Are the multiple records dups? This post needs more info what do mean by interval?
|
|
|
|
|
The "interval" is the time span during which dups were inserted in seconds. I though "interval" seemed appropriate.
I've since found out that the multiple records are not dups. So there is no longer a need to do the record comparison and mark them in any way. We just need the vendor to answer a phone call so we can understand their model and eventually write a valid statement to aggregate all the related repair records by repair. (For example, an operator sees that a repair is needed, hits the button, automated machine repair happens, repair not effective, hits the button" should be 1 repair event, not 2).
_i
|
|
|
|
|
any one remind me how to update,delete on asp.net based on given txtfield?
e.g we write code like this in oracle:
--update code:
update EMP set f_name=:txt_name
where id=:txt_id;
commit;
---delete code:
delete from EMP
where id=:txt_id;
commit;
yesser
yasser
|
|
|
|
|
Best way to do this is through parameterized queries. See this[^] article for advice.
Obviously, you will want to use the Oracle .Net providers.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
imports system.data.sqlclient
dim objsqlconn as sqlconnection
dim objsqlcmd as sqlcommand
dim dataset as dataset
dim strupdate as string
first update
objsqlconn=new sqlconnection("user id=sa;password=;initial catalog=databasename;data source=servername")
objsqlconn.open
strupdate="update EMP set f_name=:txt_name where id=:txt_id"
objsqlcmd=new sqlcommand(strupdate,objsqlconn)
objsqlcmd.executenonquery()
messagebox.show("Record successfully update")
second delete
objsqlconn=new sqlconnection("user id=sa;password=;initial catalog=databasename;data source=servername")
objsqlconn.open
strdelete="delete from EMP where id=:txt_id"
objsqlcmd=new sqlcommand(strdelete,objsqlconn)
objsqlcmd.executenonquery()
messagebox.show("Record successfully delete")
|
|
|
|
|
Thanks rohitsrivastava this is very Advance code ,but at the moment am using access database .I want only the Syntax or the command to delete,update.
I remmber in the past I was writing like this but am not soure about the Syntax
updatecode="update EMP set f_name Val&"(first_name.txt)"&''&"where id=Val&"(txtid.txt)"&"
-- modified at 8:07 Wednesday 12th September, 2007
yasser
|
|
|
|