|
Thanks Kschuler for your response.
I have tried this function from one Form and it is working fine , but when I am calling this from another form then it is showing me the error.
Can you tell what might be the problem ? I had also put the con1.open() statement inside a try catch block but that is also showing me the same error message.
Please Help.
Sekhar
|
|
|
|
|
Maybe your connection is already open. You should replace con1.Open() with this:
If con1.State <> ConnectionState.Open Then<br />
con1.Open()<br />
End If
Also, you should put a Finally block on your try catch, and close the connection after you run an ExecuteNonQuery or an ExecuteScalar. You can use something similar to how you open it, like this:
If con1.State <> ConnectionState.Closed Then<br />
con1.Close()<br />
End If
Some other things I noticed in your code...you're importing sqlclient, but you are not using it, so you probably don't need to import it (unless you are using it in code that you didn't post) Also, you declared a dataadapter object, but you are not using that either (again, unless you just didn't post it)...you also might want to look at disposing objects when you are done with them. For example, once you've used the command object at the end of you function, you could dispose it.
Hope this helps.
|
|
|
|
|
hi all.
I have a panel (container) which has multiple panel controls in it.
How can I get zoom/scroll on the panel - as a group
Also, for the panel, how can I implement panning (using the "hand" to move around?
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Hi..
To make panels inside the parent panel u have to do the following
- Put a scroll bar in the parent panel
- Make the max property of the scroll bar as (sum of height of all inner)–(height of parent / container panel)
- Same think can be done for width also if u require
- Now on move of scroll bard u can have the value of scroll bar and keep subtracting/adding in the top value of inner panels
- You can use mouse curser property on panels to show the curser u want
- To move the inner panel with the mouse, store the point when on mouse down
- On mouse move u can find the new point and have what is the difference between mouse down and mouse move new point and move the top and left of the panel accordingly
I am hoping this will help u, just giving logical idea of how do we do it.
Good Luck
|
|
|
|
|
<br />
class CCombObj : public CObject <br />
{<br />
public:<br />
DECLARE_SERIAL( CCombObj )<br />
<br />
class CProCombObj : public CCombObj<br />
{<br />
I have tried to already these codes in derived CObject class to pass to another class but in the same header file. Is there anyone can help me on this topic? I get a bug when the compile.
Error: CCombObj undefined
modified 13-Mar-13 6:01am.
|
|
|
|
|
And this has what to do with VB.NET??
You're probably looking for the Visual C++ forum..
|
|
|
|
|
Hi,
I know there are a lot of articles on this subject, but none of them have concrete solution, so please could you give a small example of one code block which connects to an IP over the internet and sends a file (Asynchronusly) and one code block of a receiver which receives the file. (Asynchronusly)
Thank you!
|
|
|
|
|
How i can know the state of the communication of winsock control in VB.NET ?
Thanks'
|
|
|
|
|
VB.NET has made significant changes to the way these things work, and basically you shouldn't use the WinSock control in .net.... take a look at the System.Net and System.Net.Sockets namespaces instead.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
If we create a dataset then it allocates some meomory . How to deaalocate that memory, if needed?
|
|
|
|
|
Call Dispose on the DataSet object.
myDataSet.Dispose()
|
|
|
|
|
Hello every one
I am using a datagridview to make a billing application
What I am trying to do is on leave event of any cell, multiply amount and quantity cells of the current row and display it in total cell
The issue I am facing is
- it dose not happens as desired when I change any of amount or quantity and move to some other cell
- It works when I change the cell for the second time
Can any one tell me y is it working this way…
|
|
|
|
|
I have a project that sounds similar, and i use the CellValueChanged event of the grid. If that doesn't work for you, try posting your code so we can see what you are doing to help you.
Hope this helps.
|
|
|
|
|
I don't have any idea, may I have some links?
|
|
|
|
|
Consult the great oracle that is Google[^]
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi friends,
How can I use this namespace System.Net.networkinformation in .net 1.1.I cannot get this in 1.1. Tell me the alternate namespace.
Thanks in Advance
|
|
|
|
|
Hariharan wrote: How can I use this namespace System.Net.networkinformation in .net 1.1.
You can't. It's new in framework 2.0.
Hariharan wrote: I cannot get this in 1.1.
Correct.
Hariharan wrote: Tell me the alternate namespace.
There isn't one. You have to use windows API calls to do something like that in framework 1.1.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi,
I am creating a reporting tool, and some reports are running for a longer time (2 to 6 minutes). I now want to run them on the background and add a cancel button. I have tried to get this to work with the backgroundworker control, but failed as I want to update a textbox while the enumeration is running. How can I create a seperated thread where the report is created, update a textbox and add a cancel button.
Here is my code sofar with, the thread does not seem to work as the form freezes when I change somethis (tying to select another report, etc.)
Private Sub cmSelectReport_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles cmSelectReport.ItemClicked
'MsgBox(e.ClickedItem.Text & " " & Me.tvSelectReport.SelectedNode.Text)
Dim bThread As New Threading.Thread(AddressOf rptRun)
bThread.IsBackground = True
TextBox1.Clear()
bThread.Start(LCase(SelectedNodeText))
End Sub
Public Delegate Sub rptRunDelegate(ByVal j As String)
Public Sub rptRun(ByVal j As Object)
Select Case j
Case LCase("RootDSE objects")
Dim objADObject As New DirectoryEntry("LDAP://dc=samp,dc=dev")
DisplayChildren(objADObject, " ")
End Select
End Sub
Public Delegate Sub DisplayChilderenDelegate(ByVal objADObject As DirectoryEntry, _
ByVal strSpaces As String)
Sub DisplayChildren(ByVal objADObject As DirectoryEntry, _
ByVal strSpaces As String)
If Me.TextBox1.InvokeRequired = True Then
Dim t As New DisplayChilderenDelegate(AddressOf DisplayChildren)
Me.Invoke(t, New Object() {objADObject, strSpaces})
Else
TextBox1.AppendText(strSpaces & objADObject.Name)
End If
Dim objChild As New DirectoryEntry()
For Each objChild In objADObject.Children
DisplayChildren(objChild, strSpaces)
Next objChild
End Sub
|
|
|
|
|
Hi all,
I have created a project under vb.net. How should I deploy it in other computers which are not having .net framework. In brief how to create setup or exe and execute it on other systems.
|
|
|
|
|
The setup wizard is a go place to start. Click File, Add, New project. Once created right click the project name in the explorer to make the .net framework a prerequisit.
|
|
|
|
|
This is my code to get the LAN connection status.
LBox.Items.Clear()
Dim childEntry As DirectoryEntry
Dim ParentEntry As New DirectoryEntry
Try
ParentEntry.Path = "WinNT:"
For Each childEntry In ParentEntry.Children
Select Case childEntry.SchemaClassName
Case "Domain"
Dim SubChildEntry As DirectoryEntry
Dim SubParentEntry As New DirectoryEntry
SubParentEntry.Path = "WinNT://" & childEntry.Name
For Each SubChildEntry In SubParentEntry.Children
Select Case SubChildEntry.SchemaClassName
Case "Computer"
LBox.Items.Add(SubChildEntry.Name)
End Select
Next
End Select
Next
Catch Excep As Exception
MsgBox("Error While Reading Directories")
Finally
ParentEntry = Nothing
End Try
End Sub
i use this code to get all Machines on the Local Area network .
here one problem occured
when i SWITCH ON my server,i get the list of machines name whatever, connected in Local Area network.after 5 min again i run the application
i didn't get antything
plz give the solution
|
|
|
|
|
can anybody tell me what are the equivalent of VB code in C#
"vorep As CRAXDRT.REPORT"--- what to do for this one means what assembly i need to add.
Set m_voApp = CreateObject("CrystalRuntime.Application")--- how to create the object for this...
and what is the use of this...
please help me...
vikas da
|
|
|
|
|
use the following link
http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
|
|
|
|
|
But this is not working .. means converted code...
can u please tell me what is the use of above codes present in my first post...
vikas da
|
|
|
|
|
Hi all,
i am developing a windows application in which i want to give authentication for the user to login.
Please help me how to give authentication in windows application.
Regatds,
Mohan
|
|
|
|