|
Don't start a new thread for follow up questions.
Christian was talking about physical limitations, it has nothing to do with the programming language you are using.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
I wondered if anyone could help me (again). In a database, I have a list of users and their portfolio paths. I have got them to load into a list box. I need it so when a user clicks on a user ID from the list box, it shows the content of the folder in an explorer style window (using icons).
Being good at VB6, I can do that quite easily and the standard TreeView in .net is a bit dull and I have no idea how to do what I need to do.
Could anyone help me with this problem?
My sincere thanks.
|
|
|
|
|
Hi,
I wondered if people could help. I have a program which imports users and creates a folder for the user. The users details (including network username, folder path etc) are stored in a database. That all works fine.
I now need, as part of the import process, for the program to set the folder permissions so that the user has modify access permission and the group 'staff' have full control. Being new to this, I am a little confused as to how to do it. I have looked into it online, but it is not clear.
Could anyone help me please?
-- modified at 16:56 Tuesday 6th November, 2007
|
|
|
|
|
Hi Everyone,
I wondered if anyone could help me. I am baffled with this one. I am trying to allocate permissions on folders within my program. I am aliasing Imports Microsoft.Win32.security. When I do, I just get the error: Namespace or type 'security' for the Imports 'Microsoft.Win32.security' cannot be found.
Any ideas?
Many thanks.
|
|
|
|
|
Have you added the reference to the appropriate assembly. (Right click on the project in the solution explorer and select "Add Reference..." and pick the assembly from the list in the first tab)
|
|
|
|
|
Found it, just as you suggested it. Thank You
Not used to VB.Net Environment.
Many thanks.
|
|
|
|
|
chrischome wrote: Found it, just as you suggested it. Thank You
You're welcome.
|
|
|
|
|
I have a Windows Forms Project with a form that has a DataGridView with 15 columns. Depending upon criteria when the user navigates to the form, some of the columns are hidden. Some of the columns are defined at design time, and some of the columns are added via connecting the DataGridView to a datasource in the page load event. After loading the DataTable that is the DataSource to the grid, I set the DisplayIndex of each DataGridViewColumn to the order I want them to appear in. However, when the screen loads, they are still not in that order. I have added code to make the DisplayIndex appear in the column header text, and it goes
0, 2, 4, 3, 5 ...
Column 1 in this case was not visible, which was correct...but why isn't it
0, 2, 3, 4, 5 ...
I tried NOT hiding the columns I want to make invisible and that didn't fix it. I made sure I'm setting the DisplayIndex for all of the columns and that didn't fix it. I'm out of ideas. What other settings are involved with reordering the columns on a DataGridView? Or what other settings could interfere with this? I would appreciate any help or advice.
|
|
|
|
|
hi,
how detecting headset mic plugged in to computer?
|
|
|
|
|
can't. The only possible way is to detect input on the mic, you can't just tell it is there.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
when i update a record in the database, the database becomes updated but the oledbdataadapter does not relect this changes until i restart the application. when I deployed the application, the changes do not even reflect even when I restart the application though the updated record appears in the database
this is the code i use to refresh the dataset.
Try
DsAsets1.Clear()
OleDbDataAdapter1.Fill(DsAsets1)
count()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I am using Ms Access as my database.
David T. Motajo
-- modified at 16:01 Tuesday 6th November, 2007
|
|
|
|
|
What do you mean that the oledbdataadapter object doesn't reflect the change? Because if you mean that it doesn't show the updated data, then you are looking at the wrong object. The DataAdapter is used to update the database, but it doesn't contain the data. The DataSet object does. That would DsAsets1 in your code. How are you displaying your data? How are you determining that the change is not being reflected in your app?
|
|
|
|
|
I am using textboxes to display the data and a navigator to browse through it. but the dataset cant pick up the newly updated record unless i restart my application.
this is the code i use to insert data in the database. I'll try and keep it short by just giving you the insert statement.
mycmd = "Insert into Assets(AssetID,AssetDescription,AssetCategory,Department,DateAcquired,Cost,ModelNumber,DepreciationPercent,MaintenanceType,comment,Location) Values ('" & assetId & "','" & assetdescription & "', '" & assetcategory & "', '" & department & "', #" & dateacquired & "#, '" & costprice & "', '" & modelnumber & "', '" & depreciation & "', '" & maintenancetype & "', '" & comment & "','" & location & "')"
conn.Open()
mycommand.Connection = conn
mycommand.CommandText = mycmd
myadapter.InsertCommand = mycommand
myadapter.InsertCommand.ExecuteNonQuery()
conn.Close()
and this is the code i use to retrieve the data from the database.
Try
DsAsets1.Clear()
OleDbDataAdapter1.Fill(DsAsets1)
count()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
when I search for the data using the following code, I could see the data but the dataset can not pick it up
conn.Open()
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT AssetId, assetDescription, assetCategory, Department, DateAcquired, Cost, ModelNumber, DepreciationPercent, MaintenanceType, Comment,Location FROM Assets WHERE AssetID = '" + assetId + "'"
Dim reader As OleDbDataReader = cmd.ExecuteReader()
reader.Read()
If reader.HasRows Then
txtAssetNo.Text = (reader.GetString(0))
txtDescription.Text = (reader.GetString(1))
cmbCategory.Text = (reader.GetString(2))
cmbDepartment.Text = (reader.GetString(3))
dtpDateAcquired.Text = (reader.GetDateTime(4))
txtCostPrice.Text = (reader.GetDecimal(5))
txtModelNumber.Text = (reader.GetString(6))
txtDepreciation.Text = (reader.GetDecimal(7))
cmbMainType.Text = (reader.GetString(8))
txtComment.Text = (reader.GetString(9))
txtLocation.Text = (reader.GetString(10))
BindingNavigatorPositionItem.Text = 1
BindingNavigatorCountItem.Text = "of " & "{1}"
BindingNavigatorMovePreviousItem.Enabled = False
BindingNavigatorMoveNextItem.Enabled = False
txtFind.Text = ""
|
|
|
|
|
Do you have the .SelectCommand.CommandText set in the OleDbDataAdapter1 object before you retrieve data from the database? It should be the same as your SELECT when you are using the OleDbDataReader. You also must have the connection set, but I'm assuming you just didn't show us that code. So how are you tying the DataSet to the textbox/navigation controls? Are they showing the OLD data, or do they just get cleared after you perform an update?
You should try to put a breakpoint on the line right AFTER you've filled the DataSet. Then quickwatch the dataset and look at the data you have brought back. Here you will be able to see if the DataSet is actually bringing back the updated data. If the data is the updated data, then the problem is however you are connecting your textboxes to the DataSet.
I do things very different than you, so I'm kind of confused by your code in general. If you are just going do an execute non query you can do that with just a Command object, you don't need the DataAdapter. Like this:
mycmd = "Insert into Assets(AssetID,AssetDescription,AssetCategory,Department,DateAcquired,Cost,ModelNumber,DepreciationPercent,MaintenanceType,comment,Location) Values ('" & assetId & "','" & assetdescription & "', '" & assetcategory & "', '" & department & "', #" & dateacquired & "#, '" & costprice & "', '" & modelnumber & "', '" & depreciation & "', '" & maintenancetype & "', '" & comment & "','" & location & "')"
conn.Open()
mycommand.Connection = conn
mycommand.CommandText = mycmd
mycommand.ExecuteNonQuery()
conn.Close() Also, you may want to look into using parameters for insert statements like this, to avoid SQL Injection. And there are ways to update the DataSet and have it automatically generate the proper Insert or Update or Delete statements for you. You may want to look at some articles about this if you are interested.
|
|
|
|
|
when i perform an update, the data in the database get updated but the dataset does not refresh to show this update even when i cleared and refill data into it. I have also tried to insert a breakpoint on the line right after filling the dataset and then quickwatch the dataset but it doesnt contain the updated record.
|
|
|
|
|
Hi,
I want to pass a string array to a c++ function, which is the interface of my ActiveX control.
My previous VB6 in the following works fine:
Dim arrayStr As Variant
Redim arrayStr(5) As String
'call the C++ function
fun(arrayStr)
the definition of the C++ is like this:
fun(Variant Far * strarray);
Now I want to update the VB code from version 6.0 to .net. but I always got a type mismatch error or other error if I do it like this:
Dim arrayStr() As String
...
fun(arrayStr)
Any help will be appreciated!
|
|
|
|
|
How can i send text to another application textbox?
Thanks
|
|
|
|
|
Hi,
I am using VB Express 2005 in order to create a from which can contain an excel document. I have been able to open the excel document no problem by using a webrowser component on the form. Unfortunately I cannot view any of Excels menus or toolbars. Can Anyone tell me how to do this ? I have looked at some code online which uses the webbrower.document to create an object by which you can then save, and also view toolbars but I can't get this to work. Any help would be greatly appreciated.
|
|
|
|
|
|
How can i convert a speech to text
Bizzo
|
|
|
|
|
How come when you google for a programming concept (something that you should consider trying), you almost always end up back at The Code Project?
http://www.codeproject.com/audio/SAPI.asp[^]
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Guffa wrote: you almost always end up back at The Code Project?
Because this is the best site for programming information anywheres on the 'net
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
How do you lookup a value that appears more than once in a column?
For example
a 10
b 50
g 89
f 7
t 58
a 56
a 25
a 69
How can i select all the a's and display their individual results? eg
a 10
a 25
a 69
Thanks for your help
|
|
|
|
|
How can I access the registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrnetVersion\App Paths ?
Anyone knows this ? Please help.
Thanks in advance.
Sekhar
|
|
|
|
|
Use Microsoft.Win32.Registry to create a Key and the same one to open it by using its CreateSubKey or OpenSubKey e.g.
Dim reg As Microsoft.Win32.Registry
Dim tmpreg As Microsoft.Win32.RegistryKey
reg.CurrentUser.CreateSubKey("Software\xx\xx\xx\")
As it returns a RegistryKey when you open it use Microsoft.Win32.RegistryKey to get the value or to set the value by using its GetValue or SetValue Properties.
Hope it helps !
AliAmjad(MCP)
First make it Run THEN make it Run Fast.
|
|
|
|
|