|
Have a look at the SYSTEM.IO namespace it does everything you need.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
At the time of creating Registry Key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run the error message shows "Attempted to perform an unauthorized operation.". I am developing application in Vista Environment whether UAC is Enable.
Thanks
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
First don't double post
Why do you need to write to this registry key? Its considerd bad practice.
This sounds alot like you are trying to write some sort of malware.
So without more explanation to what you want and why I doubt anyone will answer your question.
|
|
|
|
|
I want to set application to Startup for running at windows loading.
If you have any idea for that help so Help me.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
I'v never done this before so I could be wrong (and I don't use vista so might not work in vista) but isn't it enough to set a shortcut in the 'startup' folder to your program (wich I think you can do within the setup).
There is no need for a registry entry.
And once more unless you explain why you want this I doubt you'll get more info than that.
It's more and more starting to sound like a malware program and nobody will help you write one off those.
|
|
|
|
|
The only way your user can write to that key is if they run your application as an administrator.
|
|
|
|
|
I am already login with Administrator account.But the problem is generat when UAC is enable.
mailto: anubhava.prodata@gmail.com
modified on Wednesday, December 10, 2008 11:51 PM
|
|
|
|
|
No, your not. Admin level accounts are still running as normal users, until you need the Admin level access. Right-click the app's icon and pick "Run as Administrator" to really run it as an admin.
|
|
|
|
|
Hi,
I have found a idea for Creating registry entry in HKEY_LOCAL_MACHINE in Vista whether UAC is enable.
You can use Exe with MANIFEST as admin Previleges. Or Run the programme as Administrator.
Best Regards
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
modified on Monday, December 22, 2008 1:03 AM
|
|
|
|
|
Good luck with that. I highly suggest creating a normal user test account on the machine and testing your application under that account instead of the one you used to develop the app under.
|
|
|
|
|
hellooo frds plzz help me out
I want to retrive data from a stored procedure after execution of it into recordset
Stored Procedure is executing but in vb its giving error "Operation is not allowed when object is closed" at line no 10
below is my vb code plzzzzzzzzzz help mee its urgent
1 Dim con As New ADODB.Connection
2 con.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=CM;Data Source=(local)"
3 Dim cmd As New ADODB.Command
4 cmd.ActiveConnection = con
5 cmd.CommandType = adCmdStoredProc
6 cmd.CommandText = "Sp_selectlocation"
'Dim rec As New ADODB.Recordset
7 Dim rec As ADODB.Recordset
'rec.CursorType = 3
'rec.CursorLocation = 3
'rec.LockType = 1
'rec.Open cmd
8 Set rec = cmd.Execute
'Navigate through the multiple recordsets..
9 While Not rec Is Nothing
10 While Not rec.EOF 11 For i = 0 To rec.Fields.Count - 1
12 Debug.Print rec.Fields(i).Name & ": " & rec.Fields(i).Value
13 Next
14 rec.MoveNext
15 Wend
' Move to the next recordset..
16 Set rec = rec.NextRecordset
17 Wend
' ‘rec.Close
18 con.Close
Thanks in advance plzzzzzzzzz help me out
Parag
modified on Wednesday, December 10, 2008 4:46 AM
|
|
|
|
|
First, it's not "urgent". Second, you seem to have something leaning on the "z" key. Remove it please.
It looks like your connection isn't really opened. You may want to check for this before you call your Execute method or single step through your code, line-by-line, checking what's happening yourself.
|
|
|
|
|
How to USE TAPI in vb.net
I want to develope a software that can dial a phone and when answer the B party play a wave file automatically.Please help me....
|
|
|
|
|
Phone spam program?
Do you have a specific question, because no one here is going to write your program for you?
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Personally I would not waste my time trying to get it right. I would use one of the dev libraries that are available that sit on top of Tapi and give you the VB.Net interface.
This[^] is one of them that I have heard of. The guy that runs the company has tons of Tapi experience and this seems to be a solid product from what I have heard. It runs across a wide range of hardware.
One word of advice from a 'telephony guy'... What you want to do, done RIGHT, needs the proper hardware. Yes you can use a modem and get away with it but if you really want to do proper call progress detection then use the hardware that was meant for it. That means spending a little bit on the telephony interface hardware but your results will be much better than trying to use some 'el cheapo single line modem device that a lot of folks try to get away with.
|
|
|
|
|
I have one MDI forms & several child forms in my application. When i am opening child form in MDI from , its open perfectly, but when MDI form is resizing, it does not showing scroll bar & i am unable to see whole child form.
In child forms, border is none & control box is invisible.
|
|
|
|
|
You Can Use TableLayoutPanal for adjusting your form in MDI form.Use Tablelayoutpanel Dock Propery to Fill in MDI.
Best Regards
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
I run codes to get all the columns for all my table in database using sqldatareader. But then the sqlserv.exe use up too many memory. i tried to dispose everything at the end of the program but still not work. or is it anything to do with the sql server 2005 itself?
this is the sample of my code.. i know it sounds noob, but i just want to get it work.. =_=''
Dim oraCommand As OracleCommand
Dim oraDr As OracleDataReader
Dim sqlCommand As SqlCommand
Dim sqlDr As SqlDataReader
Dim oraFieldCount, sqlFieldCount As Integer
Dim oraArr, sqlArr As New ArrayList
Dim strMissColPK, strMissColNotPK, strMissCol As String
Dim oraCount, sqlCount As Integer
Me.RichTextBox1.Clear()
If Me.chkData.Checked = False And Me.chkCol.Checked = False And Me.chkTable.Checked = False Then
Exit Sub
End If
For i As Integer = 0 To Me.ListBox1.SelectedItems.Count - 1
Try
oraCount = 0
sqlCount = 0
oraCon.Open()
oraCommand = New OracleCommand("select * from " & Me.ListBox1.SelectedItems(i).ToString, oraCon)
oraDr = oraCommand.ExecuteReader
oraDr.Read()
oraFieldCount = oraDr.FieldCount
oraArr.Clear()
For j As Integer = 0 To oraDr.FieldCount - 1
oraArr.Add(oraDr.GetName(j).ToLower)
Next
oraDr.Close()
oraCommand = New OracleCommand("select count(*) from " & Me.ListBox1.SelectedItems(i).ToString, oraCon)
oraDr = oraCommand.ExecuteReader
If oraDr.Read Then
oraCount = oraDr(0)
End If
sqlCOn.Open()
sqlCommand = New SqlCommand("select * from " & Me.ListBox1.SelectedItems(i).ToString, sqlCOn)
sqlDr = sqlCommand.ExecuteReader() ## Here is where the system use about 2mb for each table. I have 400+ table ##
sqlDr.Read()
sqlFieldCount = sqlDr.FieldCount
sqlArr.Clear()
For j As Integer = 0 To sqlDr.FieldCount - 1
sqlArr.Add(sqlDr.GetName(j).ToLower)
Next
sqlDr.Close()
sqlCommand = New SqlCommand("select count(*) from " & Me.ListBox1.SelectedItems(i).ToString, sqlCOn)
sqlDr = sqlCommand.ExecuteReader()
If sqlDr.Read() Then
sqlCount = sqlDr(0)
End If
If oraFieldCount > sqlFieldCount Then
strMissCol = ""
strMissColPK = ""
strMissColNotPK = ""
If Me.chkCol.Checked Then
msgOut(" ================ Column not match." & Me.ListBox1.SelectedItems(i).ToString & ". Oracle Field: " & oraFieldCount & ", SQL Field: " & sqlFieldCount & ". " & " ================")
For j As Integer = 0 To oraArr.Count - 1
If sqlArr.IndexOf(oraArr(j)) = -1 Then
Dim oraComm As New OracleCommand("select NULLABLE from USER_TAB_COLUMNS where TABLE_NAME='" & Me.ListBox1.SelectedItems(i).ToString & "' AND COLUMN_NAME='" & oraArr(j).ToString.ToUpper & "'")
Dim da As New OracleDataAdapter(oraComm.CommandText, oraCon.ConnectionString)
Dim dt As New DataTable
da.Fill(dt)
If dt.Rows(0).Item(0).ToString = "N" Then
strMissColPK &= oraArr(j) & ", "
Else
strMissColNotPK &= oraArr(j) & ", "
End If
strMissCol = oraArr(j) & ", "
da = Nothing
dt = Nothing
End If
Next
msgOut("Oracle Records: " & oraCount & ", SQL Records: " & sqlCount)
msgOut("Additional Column in Oracle: " & strMissCol.TrimEnd(", "))
msgOut(" NotNULL : " & strMissColPK.TrimEnd(", "))
msgOut(" Normal : " & strMissColNotPK.TrimEnd(", "))
errorExist = True
End If
ElseIf sqlFieldCount > oraFieldCount Then
strMissCol = ""
strMissColPK = ""
strMissColNotPK = ""
If Me.chkCol.Checked Then
msgOut(" ================ Column not match." & Me.ListBox1.SelectedItems(i).ToString & ". Oracle Field: " & oraFieldCount & ", SQL Field: " & sqlFieldCount & ". " & " ================")
For j As Integer = 0 To sqlArr.Count - 1
If oraArr.IndexOf(sqlArr(j)) = -1 Then
Dim sqlComm As New SqlCommand("select clmns.is_Nullable from sys.tables AS tbl INNER JOIN sys.all_columns AS clmns ON clmns.object_id=tbl.object_id where tbl.name='" & Me.ListBox1.SelectedItems(i).ToString & "' and clmns.name='" & sqlArr(j) & "'", sqlCOn)
Dim da As New SqlDataAdapter(sqlComm.CommandText, sqlCOn.ConnectionString)
Dim dt As New DataTable
da.Fill(dt)
If dt.Rows(0).Item(0).ToString = "0" Then
strMissColPK &= sqlArr(j) & ", "
Else
strMissColNotPK &= sqlArr(j) & ", "
End If
strMissCol &= sqlArr(j) & ", "
da.Dispose()
dt.Dispose()
End If
Next
msgOut("Oracle Records: " & oraCount & ", SQL Records: " & sqlCount)
msgOut("Additional Column in SQL: " & strMissCol.TrimEnd(", "))
msgOut(" NotNULL : " & strMissColPK.TrimEnd(", "))
msgOut(" Normal : " & strMissColNotPK.TrimEnd(", "))
errorExist = True
End If
Else
If Me.chkData.Checked Then
msgOut(Me.ListBox1.SelectedItems(i).ToString & ". Oracle Field: " & oraFieldCount & ", SQL Field: " & sqlFieldCount)
If oraCount <> sqlCount Then
msgOut("Not same ============>> Oracle Records: " & oraCount & ", SQL Records: " & sqlCount)
Else
msgOut("Oracle Records: " & oraCount & ", SQL Records: " & sqlCount)
End If
End If
End If
oraDr.Close()
sqlDr.Close()
CType(sqlDr, IDisposable).Dispose()
sqlCommand.Dispose()
oraDr = Nothing
sqlDr = Nothing
sqlCommand = Nothing
oraCon.Close()
sqlCOn.Close()
GC.Collect()
Catch ex As Exception
If oraCon.State = ConnectionState.Open Then
oraCon.Close()
End If
If sqlCOn.State = ConnectionState.Open Then
sqlCOn.Close()
End If
If Me.chkTable.Checked Then
errorExist = True
msgOut("================ Error:" & Me.ListBox1.SelectedItems(i).ToString & ". " & ex.Message & "================")
msgOut("Oracle Records: " & oraCount & ", SQL Records: " & sqlCount)
End If
End Try
Next
oraCon.Dispose()
sqlCOn.Dispose()
MsgBox("Check complete!")
modified on Wednesday, December 10, 2008 2:57 AM
|
|
|
|
|
Without reading through your code I have a couple of points that may be relevant.
1 You are using sql strings - you should be using stored proc.
2 I would use datatables for every single one of your cmd.executereader. A datareader maintains the connection while you are procesing the data, a datatable is disconnected from the connection as soon as you complete the load.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
i didnt use datatable because the table is too large. but suddenly i realize i can just "select top 1" =_=
btw, will this solve the problem of memory leak?
Wat key(s) do gamer press most?
WASD
Wat key(s) do Programmer press most?
Ctrl C + Ctrl V
|
|
|
|
|
If you're looking at TaskManager to see the memory statistics, you're looking at the wrong stats. TaskManager is showing you about how much memory is reserved by the .NET CLR that is running your app. It is NOT the amount of memory your app is actually using.
If you want to see much more accurate stats, use Performance Monitor instead. There are a bunch of .NET Memory counters you can look at that won't "lie" to you.
|
|
|
|
|
but it's actually the sqlserv.exe that use up the memory. it reach above 1GB if i continue to run the program. i try to run the code in debug mode, if i stop it, it wouldn't free up the memory also.
Wat key(s) do IM user press most?
> ENTER - to send msg
Wat key(s) do gamer press most?
> WASD
Wat key(s) do Programmer press most?
.
.
.
> Ctrl C + Ctrl V
|
|
|
|
|
neo_6053 wrote: Wat key(s) do Programmer press most?
Depends on the programmer...
For some it's the Z key... as in "plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz hlp me!!!!".
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
If the memory usage is in SQL Server, then you need to optimise your SQL and how you call SQL Server to limit memory usage.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thx. But what should i do? How to optimize?
FYI, i 've change to use sqldataadapter, it seems to use less memory, but still it wont free up after used.
and btw, as can seen from my code, i used oracle reader too. it does not have any problem.
Wat key(s) do gamer press most?
> WASD
Wat key(s) do Programmer press most?
> Ctrl C + Ctrl V
|
|
|
|