
kejpa
Avatar/Signature-
Posts
321 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by kejpa
-
Nope, not here at least :(
-
So I shouldn't be using the fine new splendid function of the treenodes collection?!? /Kejpa
-
Hi, I want to check if a node is already in the treeview of mine. I guess I should use the .Contains method, but how does it work? I'm supposed to have a TreeNode object as argument!!?? tvwValue.Nodes.Contains(New tvwValue.Nodes.Add("Check")) returns false, but the node is created and so the treeview always contains the node after the call. tvwValues.Nodes.Contains(New TreeNode("Check")) returns false even if there is a node "Check" Please help me :confused: /Kejpa
-
Hi, I've done a databinding in a listbox to a StringCollection. When I add (and remove) items from that collection I want the listbox to be redrawn. Is it supposed to be done with a Event, at the moment I disconnect and connect every time I change the StringCollection but I don't find all that clever :) TIA Kejpa
-
Access databases can be protected by a database password, aswell as with a user/password defined in a system.mdw There are two different parameters in the connectionstring for the user password and the database password. I still think it's the best to make use of the udl-wizard if you're experiencing troubles with connecting. HTH /Kejpa
-
I would suggest this little nifty trick... Make a new text file on your desktop. Rename it to "WhatEverYouLike.udl" Double click it and you will get a wizard helping you to connect to your database. Once the connection is tested and functional open the udl-file in notepad and voilá there's your connection string. Copy and paste into your module and make the necessary changes for database location and such... HTH /Kejpa
-
Using my VB glasses I see some missing and misplaces " I'd have it this way this.dbCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" &_ Data Source=Server.MapPath("~/database/dbx.mdb") &_ "Jet OLEDB:System Database =Sec.mdw;" &_ "User ID =aName ; Password= 123x ;"; But I've never done any c#.... HTH /Kejpa
-
Hi, In my application I need to have a couple of filters all of the same size and kind but all holding its own data. Since I don't want to give the user of my class the ability to set different sizes or types I need to have a single property set which will apply to all filters. Can this be done? I'm stuck and appreciate all help offered. TIA /Kejpa
-
Corrado Cavalli has one on his website, http://www.codeworks.it/net/index.htm I find it very useful for any serial communication. HTH /Kejpa
-
Thanx laredo512, I think the issue was Access (surprise! Not) I set QuotePrefix = "[" and QuoteSufffix = "]" and set the insertcommand of the dataadapter to the GetInsertCommand of my CommandBuilder object. The procedure is a general update to the database and so I can't use parameters and build insert statements like you showed. I'm sending a modified datatable to the proc and then based on the changes made to the table I update, delete and insert them in the database table connected to the datatable. Regards /Kejpa
-
Hi, I've got a couple of Collection classes that I would like to use the For..each syntax on to get the items in that collection. What interfaces do I need to implement? What will the implementation look like? Regards /Kejpa Sometimes (more and more rarely though) I miss the good ol' VB6.
-
Hi, I'm still struggling with my databases, .NET still don't fancy my ideas :( I want to add a row to a table, using the beloved CommandBuilder: Private Function Insert(Table as DataTable) Dim daTemp As OleDbDataAdapter = New OleDbDataAdapter("Select * from " & Table.TableName, olocDBConn) daTemp.Fill(Table) Dim cmdCB As OleDbCommandBuilder = New OleDbCommandBuilder(daTemp) Dim aNewRows() As DataRow = Table.Select(Nothing, Nothing, DataViewRowState.Added) daTemp.Update(aNewRows) End Function But I get "Syntax error in INSERT INTO statement." How can I examine the actual statement sent to the database?!? ""INSERT INTO Hydrostatics( Fld1 , Fld2 , Fld3 ) VALUES ( ? , ? , ? )" The ? is parameters but how are they filled? What values do they have? When I examine the parameters array I see that "Value" is nothing. How come? How do I set it to the field value it's supposed to be? Regards /Kejpa
-
[QUERY SQL SERVER->ACCESS] Conversion Problem
kejpa replied to LOFRANK's topic in Database / XML / Reporting
Aouch! That's a winner, can I use it in today's contest? Just kiddin' I would have opened up Access and made the query there, adding one table at a time in the query builder and the copied the result. Access uses parenthesis like fertilizers but I guess it's the wizards way of being sure what's separated, you can most of the times remove most of them. HTH /Kejpa -
-
itm.SubItems.Add(TypeOf(itmProperty.Value).ToString()) will not compile "IS" is expected /Kejpa
-
Hi, I'd like to show the variable name of an Enum "br50Hz" instead of it's value (9). I can see it using the Watch window but when I show it in a ListView I only get the value. Strangely enough itm.SubItems.Add(itmProperty.Value.ToString) gives me 9 in the listview Console.WriteLine(itmProperty.Value.ToString) gives me br50Hz in the console window (itm is ListViewItem, itmProperty is DictionaryEntry) TIA /Kejpa
-
Thanx! So it all ends up in me not having a proper OleDbCommandBuilder object to go with my dataset. This might be fun to doodle with after all. A wild idea of mine is to pass a modified table to a general sub which will make the updates Public Sub Update(ByVal Table As DataTable) Dim daTemp As OleDbDataAdapter = New OleDbDataAdapter("Select * from " & Table.TableName, olocDBConn) Dim cmdCB As OleDbCommandBuilder = New OleDbCommandBuilder(daTemp) daTemp.Update(Table) End Sub Is this a good or bad idea? Very much politer /Kejpa
-
.NET is pretty much forget all what you've learned in VB6 :( So I've understood, I guess it's great once you get a grip, but where do I find a decent description of how to use it, with code only. I don't have any user interface with the app connected to the database. It's a C/S model where the server is handling calculations, communications with external devices including the database and the client is merely showing the results of the calculations. repentant /Kejpa
-
Solved :o The line where the handler was to be added never executed becuse the collection isn't enumerabled... For i=1 to oglbSensors.Count itm=oglbSensors(i) .... Did the trick. Sorry for borrowing your time ;) /Kejpa
-
I've been doing database programming for 10 years with DAO, ADO, ODBC and others in VB(3-6) and Delphi(4-7) and always found my way by reading the help texts and analyzing examples. Now suddenly MS is giving me hell. I don't know what objects to use, I don't know where to find obvious properties and so "suddenly I'm not half the man I used to be, there's a shadow hanging over me" to make a sensible quote. Yes, I used those variable names in order for all of you to know what they are in my head, but as I said, I'm completely lost. From the help texts I know that it's Columns, not cols but the Column object doesn't have a Value property! So today after a good nights sleep I guess my somewhat more polite question is... How do you read, modify and update a database table? Regards /Kejpa
-
Hi, I have some objects in a collection, the objects raise events and now I'd like to handle the events in a form. The collection class handles the event properly but the form doesn't and I can't see why. Could you have a quickie at it and see what I'm missing? In the form.... Dim itm As iSensor For Each itm In oglbCANSensors ' global collection of sensors If (Not itm Is Nothing) Then AddHandler itm.NewData, AddressOf NewSensorData End If Next ... Private Sub NewSensorData(ByVal Values() As Integer, ByVal Timestamp As Single, ByVal Sensor As iSensor) Console.Write ("Yeah, baby I've got it") End Sub In the collection class.... Public Function Add(ByVal SerialNo As Integer) As cSensor Dim oSensor As cSensor oSensor = New cSensor(SerialNo) mCol.Add(oSensor) AddHandler oSensor.NewData, AddressOf SensorValue Add = oSensor oSensor = Nothing End Function Private Sub SensorValue(ByVal Values() As Integer, ByVal TimeStamp As Single, ByVal Sensor As iSensor) Console.Write ("Yeah, baby the collection got it") End Sub TIA /Kejpa
-
I'd be one of the luckiest guys at this place if I even got the syntax in order .... The database handling in .NET stinks My fragmented try... Dim dtRow as ?!?!?? Dim dtCol as !?!?? For each dtRow in dtTableOld.Rows dtTableNew.NewRow() dtTableNew.Col(0)=iMyInteger dtTableNew.Col(1)=iMyInteger for each dtCol in dtTable.Cols dtTable.Col(dtCol.Caption).Value=dtCol.Value next next dtTableNew.Update But as I said this will not even compile, I don't even know which objects to use. The tables are Access tables if it matters. Still quite clueless in .NET, with VB6 I'd be on to the next issue on my everlasting list... Regards /Kejpa
-
Hi, It's getting to my nerves... I'm already at 10, 10 times 10 times... I have an old table from which I want to fill values into a new table and at the same time add two more fields (the new table contains two more fields) Strategy: Open old table Open new table For each row in old_table insert new column value(0) insert new column value(1) insert all old column values Close old table close new table Current status: Open old table - Fix Open new table - Fix For each row in old_table - Fix insert new column value(0) - Fail insert new column value(1) - Fail insert all old column values - Fail Close old table - Fix Update and close new table - Fail Plz enlight my darkness! Regards /Kejpa
-
Hi, Being new to .NET handling of databases I'm just curious about how things _should_ be done. I have a database class which has a number of functions returning datasets to my other classes. In the Person's class I can modify the "Married"-status, how do I propagate this to the database? One idea is to return the modified dataset and somehow update the table based on th modified rows (not sure just how) Another idea is to have local dataadapters in the database class and on a regular basis do an update. Not sure the data in the dataadapters have the changes made in the classes though. A nice thing would be to have changes made to the database getting back to the program, but that's not necessary FYI, in the normal case there's just this application using the database, only one instance of it running. Pretty much a dedicated database (except in development when I like to fiddle with it at the same time ;) )