|
Thanks for all the help. I tryed it and it worked. Sorry for the vote. I misread your answer and acted on that. If I could take it back I would
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
hi all,
how can i move a directory (also sub directory and files) from one volume to other volume ?
Directory.Move function fails when source and target drive are different.
Please suggest
|
|
|
|
|
Dear
as much as i know you have to do complete task in two parts,
first copy all the subfoloder and files in new drive location ie. from c drive's source folder to d drive's destination folder and
second delete the folder exist in c driver ie, source folder
|
|
|
|
|
hi sumit,
sumit prakash sharma wrote: first copy all the subfoloder and files in new drive location
how can i copy folder from one drive to second
|
|
|
|
|
it's too easy and short code
now i m going to give complete code for coping and deleting
My.Computer.FileSystem.CopyDirectory("C:\SourceDirectory", "D:\DestinationDirectory")
My.Computer.FileSystem.DeleteDirectory("C:\SourceDirectory", FileIO.DeleteDirectoryOption.DeleteAllContents)
if above code is usefull then plz reply
|
|
|
|
|
it's too easy and short code
now i m going to give complete code for coping and deleting
My.Computer.FileSystem.CopyDirectory("C:\SourceDirectory", "D:\DestinationDirectory")
My.Computer.FileSystem.DeleteDirectory("C:\SourceDirectory", FileIO.DeleteDirectoryOption.DeleteAllContents)
if above code is usefull then plz reply
|
|
|
|
|
Thanks a lot sumit
5 from me
|
|
|
|
|
|
i completed one project in vb.net with msacess database.... the problem is when i came to publish the project i clicked publish from menu ........ the problem is i can't add my msacess database setup.exe file.... thats why i can't publish my project .... i need answer for my query....
|
|
|
|
|
|
I have a big file in witch i wanted to find a hex value. The hex value contains several values, for example D274D274. Can anyone help me
|
|
|
|
|
So what have you written?? This is easy enough to do. Just read the file byte-by-byte until you find the first byte in the value you're looking for. Then compare the next byte in the file to the next byte in the value. If they match, do it again on the next byte. If not, keep looking for the first byte in the value until you find it again.
|
|
|
|
|
I would like to know how to detect a video card in a splash screen and then write the values to the registry. After closing the main form and rebooting it, all the splash screen has to do then is check the registry settings and exit and display the main form.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
Why would you want to check the video card?? You can't get at it directly, or the closest you're going to get with that is through DirectX. What are you checking for??
|
|
|
|
|
All I want to know if it is ATI, NVidia, or some other brand. I do not want to access the card itself. THNX for such a quick response.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
You can use the System.Management namespace and it's classes to get all instances of the Win32_VideoController WMI class. This will give you the manufacturer and model of all the video controllers in the system. Careful, you may be surprised at what you find.
|
|
|
|
|
WOW, a lot of stuff. Anyway, Thats what I was looking for. THNX a lot for your expertise on this subject.
rspercy
1 + 1 = 186,440....Depending on the species.
|
|
|
|
|
I want to export to XML file and have problem this is the code but is not work, error is "No value given for one or more required parameters."
Private Sub GetDataFromAcessFile1()
Dim aCon As OleDbConnection
Dim aCmd As OleDbCommand
Dim strCon As String
Dim param1 As OleDbParameter
Dim param2 As OleDbParameter
Dim param3 As OleDbParameter
'create connection with mdb file
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strAcessFilePath & ";User ID=Admin;Password="
aCon = New OleDbConnection(strCon)
aCon.Open()
strQuery = "Select * from rabotnici where rabotnik_name=? and data_rabota>=? and data_rabota<=?"
param1 = New OleDbParameter("@rabotnik_name", OleDbType.VarWChar, 100)
param1.Value = ComboBox1.Text
param2 = New OleDbParameter("@data_rabota", OleDbType.Date)
param2.Value = DateTimePicker1.Value.ToShortDateString
param3 = New OleDbParameter("@data_rabota1", OleDbType.Date)
param3.Value = DateTimePicker2.Value.ToShortDateString()
aCmd = New OleDbCommand(strQuery, aCon)
aCmd.Parameters.Add(param1)
aCmd.Parameters.Add(param2)
aCmd.Parameters.Add(param3)
aCmd.ExecuteNonQuery()
aCmd = New OleDbCommand(strQuery, aCon)
Dim da As New OleDbDataAdapter
da.SelectCommand = aCmd
Dim ds As DataSet
ds = New DataSet("Customers1")
da.Fill(ds, "New Customers1")
Dim dt As DataTable
dt = New DataTable()
dt = ds.Tables("New Customers1")
CreateXMLFile()
WriteToXml(dt)
aCon.Close()
End Sub
Can You help me
|
|
|
|
|
See if this works:
Select * from rabotnici where rabotnik_name = @rabotnik_name and data_rabota >= @data_rabota and data_rabota <= @data_rabota1
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I try this but also not work again this error
|
|
|
|
|
Access (Jet) doesn't use named parameters, only question marks. You have to specifiy the parameters values in the order the question marks show up in the SQL statement.
|
|
|
|
|
Now that I am looking at this a little closer.
ivo75 wrote:
aCmd.Parameters.Add(param1)
aCmd.Parameters.Add(param2)
aCmd.Parameters.Add(param3)
aCmd.ExecuteNonQuery()
This is wrong since this is a query (select * from = a query).
ivo75 wrote:
aCmd = New OleDbCommand(strQuery, aCon)
Dim da As New OleDbDataAdapter
da.SelectCommand = aCmd
strQuery didn't get changed.....should this command be the same as the first cmd? What is the purpose of the first command?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Few comments:
- when doing select, don't use ExecuteNonQuery. Use for example ExecuteReader. However, since you later use adapter.fill you dont't need to execute anything at that point
- when assigning values to the parameters, don't modify their datatype unless the datatype in database is different. So instead of param2.Value = DateTimePicker1.Value.ToShortDateString use param2.Value = DateTimePicker1.Value
- also you created a new command and used it instead of the command where you added the parameters
So your code could be something like:
...
strQuery = "Select * from rabotnici where rabotnik_name=? and data_rabota>=? and data_rabota<=?"
param1 = New OleDbParameter("@rabotnik_name", OleDbType.VarWChar, 100)
param1.Value = ComboBox1.Text
param2 = New OleDbParameter("@data_rabota", OleDbType.Date)
param2.Value = DateTimePicker1.Value
param3 = New OleDbParameter("@data_rabota1", OleDbType.Date)
param3.Value = DateTimePicker2.Value
aCmd = New OleDbCommand(strQuery, aCon)
aCmd.Parameters.Add(param1)
aCmd.Parameters.Add(param2)
aCmd.Parameters.Add(param3)
Dim da As New OleDbDataAdapter
da.SelectCommand = aCmd
Dim ds As DataSet
ds = New DataSet("Customers1")
da.Fill(ds, "New Customers1")
...
|
|
|
|
|
Hi, advice on the use of Private Properties required (please!).
In my aplication I have classes which have variables which can be read by but not changed by other classes via Public ReadOnly Properties. Now, should the values of these variables be set within the class using Private WriteOnly properties or is it OK to directly assign to the variable?
Thanks in advance for your time.
|
|
|
|
|
I think it's partly a matter of coding style. If you just assign the value, it's simpler (and a bit more efficient) to use the field directly.
However, if you have (or you're likely going to have) somekind of logic in the assignment, it's better to use a property (or a method). For example, when assigning a value to a field, you raise and event, do some calculation, check the value etc. it would be better to have a property.
|
|
|
|