|
Simply pass the reference from one to the other.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Is there a way within vb to find which window has focus on a computer? For instance if IE, Open Office Writer and Photoshop are open, how can I programmatically tell which one has focus?
|
|
|
|
|
This would need some code class to native window function, here is C# code you can port it to VB
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class MyClass
{
[DllImport("user32.dll")]
private static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
public static void Main() {
IntPtr handle = GetForegroundWindow();
}
}
|
|
|
|
|
have created function in class file.
Public Shared Function dsCntrctET() As DataSet
Dim sqlCntrct As String = "Select * from CNTRCT_ET where CNTRCT_ID=" & CISCNO
Dim cmdCISContract As New OracleCommand
Dim daCISCntrct As New OracleDataAdapter
Dim dsCISCntrct As New DataSet
Dim cmdCISBuilder As New OracleCommandBuilder
Try
With cmdCISContract
.Transaction = myTransCIS
.CommandText = sqlCntrct
.Connection = cnCIS
End With
daCISCntrct = New OracleDataAdapter(cmdCISContract)
daCISCntrct.FillSchema(dsCISCntrct, SchemaType.Source)
cmdCISBuilder = New OracleCommandBuilder(daCISCntrct)
With daCISCntrct
.TableMappings.Add("Table", "CNTRCT_ET")
.Fill(dsCISCntrct)
.SelectCommand = cmdCISContract
.InsertCommand = cmdCISBuilder.GetInsertCommand
.UpdateCommand = cmdCISBuilder.GetUpdateCommand
.DeleteCommand = cmdCISBuilder.GetDeleteCommand
End With
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Return (dsCISCntrct)
End Function
it returns dataset that i can use for getting value from table.
but while saving data, i have to use dataadapter for da.update(ds,"table") and ds.acceptchanges.
this i have to use in multiple forms as this data comes from 3rd party so i dont want to write this in every form . so i thought how to return data adapter and dataset from the same function. as i wanted to use daCISCntrct and dsCISCntrct.
When i am saving data , and i call CISCLASS.daCISCntrct.update(CISCLASS.dsCIScntrct,"Table_Name")..it goes to function and initialize datadapter and not saving new data . it not giving me error but if i look at table, it has all old data where as if i write this code in private sub procedure , its saving data and next time i see new data in the table.
Please reply me asap.
Thanks in adavance.
|
|
|
|
|
You've posted this question numerous times now and I do believe you've been given the answer. If you don't understand the answer reply to the original post and seek clarification.
Anyway, the simple way is to change the function to a sub with two parameters, one of type DataSet and the other of type DataAdapter. Mark these parameters with the ByRef keyword (I think, I haven't done VB for quite some time) and then when you call the sub pass in an empty dataset and an empty data adapter. Inside of the sub, before you exit and at the same time as you would normally return, set the parameters to the values of daCISCntrct and dsCISCntrct, they will then be available to the calling function.
|
|
|
|
|
i understand that bu the problem now is its not saving the data when i say da.update and ds.aceeptchanges.
as when i call the da.update, it goes to da function and initialize evetything so doesnt change values in table.
how to do update and acceptchanges to the table
|
|
|
|
|
I have done a project, and I put in my network folder for users. Also I checked from my user machine it works fine.
But the problem is after making the alteration, I changed the Pblish Version-revision as 0 again. And again I put the program in network same folder I checked it was not changed in users machine...why?
really I get cinfused...
Anybody can point me, the mistake ?
Thanks
|
|
|
|
|
Are you talking about a Windows app or Web?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
windows application
Thanks
|
|
|
|
|
If i understand you correctly you have compiled you project and publish it and the changes you made does not take effect on app that you put in the network folder ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi all
I create a setup of Outlook Add-in Program which was in VB.net.
When i am installing setup on my another pc, then this add-in is not working.
I click on "Tools" menu click on "Trust Center" and click on "Add-ins".
In this window my addin is showing. When i click on Go Button then i saw that my add-in's is not check. I have check it manually, and click on OK button. then it is not working(means Check is not applied )
It's showing laod behavior error which is
"Not Loaded. A runtime error occurred during the loading of Com Add-in."
Plz help
It's urgent.
Regards
DC
|
|
|
|
|
how to generate reports using crystal report in vb
|
|
|
|
|
There are whole books written on this subject and many ways of achieving results.
Google is your friend !!![^]
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hello Experts,
I have made setup of my project....the setup is complete,but upon running the exe i get an error to only one form of my project.....
The ERROR is.........
" The Workgroup information file is missing or opeaned exclusively by another user"
Please Help Me....
|
|
|
|
|
I suspect you are using access database and have only deployed the .mdb file - security is handled by another associated file, but I cannot remember what its extension is.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
It's probably the System.mdw file he's missing.
Or some custom .mdw file.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
That'll be it. Couldn't remember the name and don't have access installed
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
How can I create Setup of vb.net window application to deploy it?
|
|
|
|
|
|
Select
New Project->Other Project Type-> Setup and Deployment->setup project.
when you click on setup project then it will show a new window
In this there are 3 folder
1 Application Folder
2 User's Desktop
3 User's Program file menu
Add your debug folder's file in Application folder
add your exe file both in desktop and program file
adding process will be done by right click on one of three folder.
remember when u are adding exe file on desktop and programm file folder then first u need to create shortcut of your exe file form application folder.
change the name of exe file and save in both desktop and program file folder
After copying all file go to Build menu and Build setup1
you will get ur setup1 folder
|
|
|
|
|
Hi all
I m facing a problem with creating Instance of Categories Interface.
I copy this code from MSDN and try to execute in vb.net application.
Dim instance As _Categories
Dim Name As String
Dim Color As Object
Dim ShortcutKey As Object
Dim returnValue As Category
returnValue = instance.Add(Name, Color, ShortcutKey)
But it is showing Error "Object reference not set to an instance of an object."
Here is the link of msdn. Can anyone solve this problem and give me suggestion with the help of code...
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._categories.add.aspx[^]
Plz help it's urgent.
Regards
DC
|
|
|
|
|
instance is not set to anything, that's why you get the error.
Try this code:
Dim instance As Categories<br />
Dim Name As String<br />
Dim Color As OlColor<br />
Dim ShortcutKey As OlCategoryShortcutKey<br />
<br />
Dim returnValue As Category<br />
<br />
Dim f As NameSpace<br />
Set f = Application.GetNamespace("MAPI")<br />
Set instance = f.Categories<br />
Color = olColorFuchsia<br />
Name = "MyCategory"<br />
ShortcutKey = olCategoryShortcutKeyNone<br />
Set returnValue = instance.Add(Name, Color, ShortcutKey)
Tosch
|
|
|
|
|
Thanks for quick response
This code is solve my problems
thanks a lot Tosch
Regards
DC
|
|
|
|
|
I am given a project on VB.NET from my college. The topics are :
1. Hospital Management
2. Hotel Management
3. Call Center Management
4. Banking System Management
I have to do any one of the above 4.
My knowledge about VB.NET is basic but I want to make this project stand out from the rest. Please help me. Is there any website where I can find valuable source code for this? Is there anyone here who can help me with this?
|
|
|
|
|
... you mean aside from the code project.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|