|
I'll try to fill my ComboBox "dynamically" with a DataReader object but I think it won't be easy because of the stream's 'Forward Only' property.
I can't understand that the Microsoft Framework don't provide any class/control to visualize data dynamically & automatically in a control (old MS Access versions were able to do this) : It's incredible, don't you think ?
Thank you for your help.
jpeg
|
|
|
|
|
I agree with you that .NET has some strange things..data bound controls in the VB6 way was great..
ADO was much better than ADO.NET which I did not understand yet why it's based on the disconnected model, while ADO can give you the same functionality if you need..
So I never liked ADO.NET !!
|
|
|
|
|
jpeg wrote:
it takes 3 or 4 seconds to paint it
I tried to load 50,000 elements into a combobox and it painted instantly.
What machine are you running off?
When are you doing the actual load into the combobox? i.e. which event
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
My developing machine is a 1.7 Ghz Celeron. So it's a quite good machine. This is not the problem. Maybe the problem is that I use C#. The initializing code (which is located in the form's loading event-handler) is :
DataTable mytable=LoadMyTable();
myComboBox.DataSource=mytable;
myComboBox.DisplayMember="myfieldname";
All this code is fast (I see it in debugging mode) but the first painting takes a lot of time (Maybe because of the internal control initializing method). After the first painting, the dropdown takes a little time.
If you have a piece of code that permit the control to be painted instantly, I'm highly interested !!!
jpeg
|
|
|
|
|
Try and populate the combobox manually.
The delay may be in the data binding itself as painting a 50,000 element combox is very quick.
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
Hi!
I want to do a simple SELECT on a table, returning the count of records containing a greater date than a certain date I write in the query expression.
Using Access, I'd simply write:
SELECT Count(1) As nMsg FROM Bacheca WHERE ([Date] > #2003/01/01 13:59:07#)
But that select statement returns an error when used in SQL Server, it says Syntax error near '13'. Can you tell me how to fix it?
And, I'd like to make that query work for both Access and SQL Server - is it possible?
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
Use ' instead of # and treat it as a string, e.g.:
SELECT Count(1) As nMsg FROM Bacheca WHERE ([Date] > '2003/01/01 13:59:07')
This won't work in Access though, AFAIK you'll need to know before hand and use the correct query for each one. Can anyone confirm or deny that?
|
|
|
|
|
Try using the ODBC timestamp format. It works in SQL server, and it should work for Access via ODBC/OLEDB. (I haven't tested it, though.)
SELECT
Count(1) As nMsg
FROM
Bacheca
WHERE
([Date] > {ts '2003-01-01 13:59:07'})
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Yep it works in SQL Server, but in Access it fails... he takes it as a GUID... BTW, this is my Access connection string, just in case... thanks for your effort anyway
adminDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("_private/db/skakkinostri.mdb")
Luca Leonardo Scorcia
http://zip.to/kojak (only in Italian)
|
|
|
|
|
How I can define that ADO Connection with MS SQL Server was failed before there are raised exceptions while ADO Command objects will run.
|
|
|
|
|
Whats your code and when does it happend?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I've an strange case where a second connection to a Sqlserver database hangs until time out has expired, the schema is below:
<br />
Connection1=New connection(database1)<br />
Connection1.Open<br />
Connection1.Begintrans<br />
...<br />
Connection2=New connection(database1)<br />
Connection2.Open<br />
Command2.Connection=Connection2<br />
Command2.ExecuteSelectionSQL |-----------------------here it hangs<br />
Connection2.Close<br />
.......<br />
Connection1.Commit<br />
Connection1.Close<br />
The first connection remains opened and in transaction while connection2 is opened with the same querystring, it opens correctly but when I issue a command using connection2 it hangs.
I use System.Data.SqlClient and I've tried different options in querystring (Enlist=false,.....) but I cannot solve the problem.
Thanks for your help,
Hzi.
|
|
|
|
|
seems like you have locking problems .. do you access the same tables ?
in both connections ?
|
|
|
|
|
Yes, when I'm accessing the same table, it hangs, but when I access another table it not hangs, but SQLServer locks a whole table when I insert a single record ?.
Thanks
|
|
|
|
|
No..
locking is not this simple..it differs according to how you access the table..
tell me the query so i can help !!
|
|
|
|
|
Here is a trace of the steps shown in sqltrace tool:
<br />
with the first connection<br />
exec sp_reset_connection<br />
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;BEGIN TRANSACTION<br />
sp_reset_connection<br />
update objectes set [Caducitat]=NULL, [DataValid]=NULL, [UltimaMod]=CONVERT(DATETIME, '2003-01-16T13:18:00', 126) where id=100225<br />
with the second connection<br />
sp_reset_connection<br />
select * from objectes where idref=''BAINtiA000046'' and IM1=1' <-------------It hangs here
It's all.
Thanks.
|
|
|
|
|
either make ur query serialised or change lock type
P.S. PATWAL
|
|
|
|
|
Using Open XML can I join fields in XML document to field in my database via in a stored procedure, perform a check, and return a dataset/XML?
Thanks
David
|
|
|
|
|
Hi developing my WEB application win ASP.NET (C#)
i got this error message in my browser
SELECT permission denied on object 'Contacts', database 'Contacts', owner
'dbo'.
this is the code where it stopped
Line 30: sqlDataAdapter1.Fill(dataSet11);
Line 31: //Update the data grid
Line 32: DataGrid1.DataBind();
Now i finally i grant the access to the database for user ASPNET but it
seems not working yet.
I am running MSDE (Sql Desktop engine)
so i am using osql dos command and scripts to grant the accesses
What i am missing ?????
Thanks
|
|
|
|
|
If you are logging into SQL Server with the ASPNET account you need to make sure that the login exists :
sp_helplogins
Verify that the ASPNET user account is created in the Contacts database
sp_helpuser
And that the uid of the ASPNET login is the same uid as the ASPNET user. (logins are to a server, users are to a database)
Then check the permission that the ASPNET user has against the table in question:
sp_helprotect
If you don't have sufficient permission, use the GRANT SELECT ON <object> TO <user>.
|
|
|
|
|
Is this possible... to determine the datatype of the column, in ACCESS database... like text/date/memo etc...
I was born intelligent Education ruined me!.
|
|
|
|
|
|
Mine is MS Access database
I was born intelligent Education ruined me!.
|
|
|
|
|
|
you could use ADOX which allows you to access an databases data definition language. I have some code which you could use, i'll post when i get into work.
"We don't understand the software, and sometimes we don't understand the hardware, but we can *see* the blinking lights!"
|
|
|
|