|
Zoltan Balazs wrote: I have, but I store only the last version of the DB.
That's fine, that's what I do. When my user logs in, the required db schema set in my app is checked against the db's stored schema number.
If the db has a higher number my app exits with a warning that it's out of date.
If the db has a lower number my app triggers a schema update that goes through a big switch statement and executes each newer schema level update until it matches the program's required version.
|
|
|
|
|
Thanks, you've given a couple of ideas
company, work and everything else @ netis
|
|
|
|
|
I'm creating Winforms database application using VCS Express 2005
I have some large lookup tables (may be up to 500000 records) which
contains name and id and are stored in sql server.
I need to create single line combobox style control which:
1. Allows to type first characters in name
2. Auto-completes entered data by using first match
3. Allows to open picklist based by entered data and select name
I tried to use Combobox with lookup table.
I can set combobox autocomplete source to lookup table and autocomplete
window shows matches very well.
Lookup parts table is big, it takes a lot of time to load the
data source.
I think I need virtual combobox control with autocomplete and selection from
list.
Is is not reasonable to load whole table as combobox lookup table during
combobox
creation like ms doc sample recommends.
I have found 2 possibilities:
1. Add some code to combobox events to implement virtual mode. Is this
possible ?
2. Create textbox, selection button and use (virtual?) DataGridView to
emulate virtual dropdown list. In this case I must create UI in code
also.
Which way is better ?
Where to find more information about this ?
Andrus
|
|
|
|
|
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
|
|
|
|