|
Take a look at Ajax: Ajax AutoComplete[^]
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
I'm thinking about creating Winforms MDI application .
Browser is inconvenient for 8 hrs data entry and GUI report designer.
How to use autocomplete in winforms application ?
Andrus
|
|
|
|
|
I have implemented a similar function by loading all the data to memory when it's first called for - like you, the time to load if done every time just made the function useless to use.
To make sure the data is kept up to date, I have triggers to log updates to another table; the program then checks this table periodically and just reads the data for the updated records. This is not a good approach if a lot of records are frequently updated - the program then spends all it's time reading updates. It's a compromise, but it works for me.
|
|
|
|
|
Thank you.
I think it is better to avoid loading all data, since user actually looks only very small part of data.
I think I need a simpler approach: autocomplete reads first match from sql server.
Pressing dropdonw button reads first 10 matched from server.
Scrolling in dropdown list reads next 10 records.
This works probably fast even without caching.
Do you have anyidea how to implement such combo ?
My major issue is which event I should capture in combobox or how to use virtual grid for this.
I havent found any such sample.
Andrus
|
|
|
|
|
I don't use winforms so don't know how to do it with that. Certainly the windows messages can be processed for standard windows, so winforms probably has something similar.
|
|
|
|
|
hi,
how i can apply transaction on a dataset ?
Neeraj
|
|
|
|
|
You can't. A dataset is a disconnected set of data.
|
|
|
|
|
Hi everyone.
pls help,I want to display data from DB to the grid
but my data looks like this: Code Name Time
1 Me 2/15/2007 10:18:00 AM
and I want the grid to look like this: Code Name Time
1 Me 10:18
how do I display/formatt only that portion of time on my grid.
|
|
|
|
|
You usually don't try to format the data coming from your database in your code, instead you set a display format on the column in the grid itself.
|
|
|
|
|
hi
i'm developing a wizard that creates triggers and i need a couple of Create Trigger examples to map the query for different triggers(of type INSTEAD OF).
if u have any tiggers urself pleaze do post here
thanks fo r ur time an effort.
|
|
|
|
|
sorry that i can't help but did u search the web?
I Wish the Life Had CTRL-Z
|
|
|
|
|
|
I have a table in SQL Express 2005 that I would like to delete the first row after a specified number of rows have been added. The table contains four columns, one of the column contains the ID number starting at 1 and is autoincremented when a new row is added. Before a new row is added, I want to check if there are already 60 rows and delete the first row before adding the new row. I want new rows to be added, but want to keep the number of rows at 60 by deleting the oldest rows. I would really appreciate it if someone can provide with an example of this.
|
|
|
|
|
may u can use triggers like this:
CREATE TRIGGER myTrigger<br />
ON myTable<br />
FOR INSERT <br />
AS<br />
<br />
BEGIN<br />
DECLARE @count int;<br />
SELECT @count = COUNT(*) FROM myTable<br />
IF(@count>60)<br />
BEGIN<br />
DECLARE @first int;<br />
SELECT @first = MIN(ID) FROM myTable<br />
DELETE FROM myTable WHERE ID=@first<br />
END<br />
END<br />
and if you want to have your ID column Identity and only from 1-60 use IDENTITY_INSERT
check msdn and web for more
I Wish the Life Had CTRL-Z
|
|
|
|
|
hi
i'm trying to use the alter table query to add the primary key constraint to a column that already exists in the table(The table has been created without specifying any primary key).
how can i do this??
i tried doing it but the server gives a message that primary key constraint cannot be added in the Alter table queryas it can be dropped through this query.
plz do explain the meaning of this message and also tell the query through which this task can be accomplished.
thanks for ur time
Saira
|
|
|
|
|
The query that works fine for me is (works on SQL Server):
ALTER TABLE MyTable<br />
ADD CONSTRAINT PK_KeyName primary key clustered (FieldName).
You can get an error message if there a re null values or duplicates
in the field you want to declare as primary key.
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
|
Your connection string looks ok, assuming you don't have instances on your sql server box. If you do have an instance you need to put that in your Data Source. I am wondering if it is some of your other code that is accessing your tables that is causing your errors.
Ben
|
|
|
|
|
hi
i am developing a web based application usin c#. i wanted to perform some searching functionality in the website.
i have laid down some fields such as Name, Age.
now i want the user can perfrom a search on any of these parameters. eg. if he just wants to perform the search on name, he may or if he wants on bothe the params, he is able.
how shud i do.
in the sql i tried with AND. but for AND. you wud need to specify both the params..
Kunal
|
|
|
|
|
Hi,
In using queies i can help u.
eg: select * from tablename where (''='aaa' or Name='aaa') and (0=16 or Age=16)
check it out with this query
Regards,
LEE
|
|
|
|
|
hi
thankx for replying.. but the querying is asking for both the parameters.
Kunal
|
|
|
|
|
Hello!
I have tested this code in SQL Query Analyser:
--/////////////////////////////////////////////
CREATE TABLE TESTDATE(
T_ID INT NOT NULL PRIMARY KEY,
TDATE DATETIME
)
-- ///////////////////////////////////////////////////
INSERT INTO TESTDATE(T_ID,TDATE) VALUES(1,'12/07/2003')
INSERT INTO TESTDATE(T_ID,TDATE) VALUES(2,'13/07/2003')
First row is inserted correctly (with date '12/07/2003') but while inserting
second row with date '13/07/2003' it gives following error:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated
My date is of formate DD/MM/YYYY but SQL Server is reading it as MM/DD/YY.
and not accepting 13 as a valid month.....
How can i resolve this problem?
colgateas900197
|
|
|
|
|
You should write SQL to be culture independent. It is the reponsibility of the Presentation layer to deal with rendering and parsing culture dependent information. You should use the ISO format when writing SQL Scripts e.g. 2007-02-14
|
|
|
|
|
You are right!
But i think i have to discuss my problem in detail!
It was a test code... Actually Database is created in ACCESS and date is stored as text in previous database. While generating reports using access database i use 'Weekday' function to get day i.e SUNDAY for 12/07/2003.
Now, I have fetched data from ACCESS to SQL server and again i put date as string using vnarchar(10) datatype. When i use
datename(dw,DateFieldName) to get name of day on specific date i get an 'Arithmatic Overflow Error'
But when i created this Test code(with datefield with datatype datetime) i have posted it was also creating problem!
I am sorry! i have written too much... but the only thing i want to do is
"Date is stored in SQL table as string with date formate DD/MM/YYYY (13/07/2003) and i want to get the name of day i.e SUNDAY"
Thank you for your response! and again i hope you will help me..
colgateas900197
|
|
|
|
|
You can use "SET DATEFORMAT dmy ". However using a date format of "20070214" or "14 feb 2007" means that you don't have to muck-around with the dateformat setting.
Andy
|
|
|
|