|
Thanks for the help,
I really appreciate it.
I shall try that outbut for now I have found a way slightly around the problem.
I have created a system odbc object that links to the .mdb file and then linked to it through odbcconnection. This has worked fine for now but I'll still try doing it the other way as i wont have to create odbc objects on each machine its to be installed on.
thanks again
mark
|
|
|
|
|
hi,
i've made an app on my pc who pings to see who's in my network and is able to send emails
i want to do the same on a pocket pc, but i cant seem to find how this works
i get stuck on the fackt that pocket pc in vs 2005 doesn't have :
using System.Net.NetworkInformation;
using System.Web.Mail;
does anybody know were i can find examples or how i send emails or ping ???
plz help!
grz muk
|
|
|
|
|
Hi,
i've created a setup project and it works fine. Now i want to retrieve the installation path because i need to set it as current directory for the windows service i've created. How can i do it?
I need to pass through windows registry (how?) or exists a variable or a property which i can read?
Thank you all!
Gianluca
|
|
|
|
|
[TARGETDIR] is the property which contains the installation directory.
You can add registry keys via the installer.
|
|
|
|
|
terrible83 wrote: because i need to set it as current directory for the windows service i've created
As someone pointed out in the past few days, best practice is to use absolute paths.
To obtain the path you can access the installation path using the Windows Installer SDK in your service, that is what you are asking correct? However AFAIK this should work:
System.Reflection.Assembly.GetExecutingAssembly().Location
|
|
|
|
|
Hi
Im doing an application in Visual C# 2005, my application can read data from my database but cant save into the database. Heres the code. What am I missing....Pliz Help!!!!
private void btnSave_Click(object sender, EventArgs e)
{
string strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;"+"Data Source=YAC.mdb";
OleDbConnection conn = new OleDbConnection(strConnection);
conn.Open();
string strCommand = "INSERT INTO ClientProfile(Name,Surname,Gender,IdNumber) Values ('" + txtName.Text + "','" + txtSurname.Text + "','" + cbxGender.Text + "','" + txtIdNumber.Text + "')";
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.InsertCommand = new OleDbCommand(strCommand, conn);
(this.yACDataSet.ClientProfile);
int t1 = adapter.InsertCommand.ExecuteNonQuery();
conn.Close();
if (t1 > 0)
{
MessageBox.Show("added successfully!");
}
csanda
|
|
|
|
|
|
I'm trying to query the registry on a remote server to verify a value. using the code
<br />
RegistryKey RemoteKey;<br />
string RemoteComputer = LabName + "isp0001";<br />
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);<br />
string value = RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed", RegistryKeyPermissionCheck.ReadSubTree).GetValue("1.3", 0).ToString();<br />
<br />
When i run it i see this:
A first chance exception of type 'System.NullReferenceException' occurred in LabMonitor.exe
A first chance exception of type 'System.NullReferenceException' occurred in LabMonitor.exe
and the exception message is: "Object reference not set to an instance of an object"
Please help
|
|
|
|
|
StevenWalsh wrote: and the exception message is: "Object reference not set to an instance of an object"
You're bound to get that when you chain together calls without first checking the return values. I'd assume that OpenSubKey is failing, but you should step through and check it yourself, and write more defensive code in future.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello Steven,
either the RemoteKey is null or
the "RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed", RegistryKeyPermissionCheck.ReadSubTree)" is null
change your code from:
RegistryKey RemoteKey;<br />
string RemoteComputer = LabName + "isp0001";<br />
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);<br />
string value = RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed", RegistryKeyPermissionCheck.ReadSubTree).GetValue("1.3", 0).ToString();
to:
RegistryKey RemoteKey;<br />
RegistryKey RemoteSubKey;<br />
string value;<br />
string RemoteComputer = LabName + "isp0001";<br />
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);<br />
if (RemoteKey != null)<br />
{<br />
RemoteSubKey = RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed",RegistryKeyPermissionCheck.ReadSubTree);<br />
if (RemoteSubKey != null)<br />
{<br />
value = RemoteSubKey.GetValue("1.3", 0).ToString();<br />
}<br />
}<br />
if (value != null && value.Length>0)<br />
{<br />
}
GanDad
|
|
|
|
|
Hi, i've tried your code, and i'm still getting the exception here is where it is stopping
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);
|
|
|
|
|
Breaking it down will just help you work out where the problem is. It won't change that you are making a call which is returning null, and not checking it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Breaking it down will just help you work out where the problem is. It won't change that you are making a call which is returning null, and not checking it.
i broke it down some more and narrowed to problem down to the string "value" i made value an object datatype and it now works.
|
|
|
|
|
|
Thats a nice specific specification so just impliment it.
You need only the most basic knowledge of c# to achive this.
|
|
|
|
|
i am in a short period of time and i do have problem on my computer..i can't practice now..i find source of this project and i try this site that someone could help me to this problem..
......
|
|
|
|
|
So because it's got to be handed in soon and you didn't do it in time you want someone else to do it for you?
|
|
|
|
|
every homework request comes with a sob story. This is really straight forward. If you try to do it yourself and you need help with specific things, that's different, but for you to just post your homework and hope someone will do it is, frankly, kind of rude.
So, I ask again, which specific bits are confusing you ? Do you want to ask some specific questions to help you in approaching this task ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Which part of your (pretty simple) homework is confusing you ? This is a basic exercise in OO. We never do homework, but this in particular, is pretty vital for you to understand, and really not hard.
I would guarentee that any text you've been assigned will cover all you need to know to do this.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This is very straightforward and do your own homework. People will help with a specific problem you may have, but not do your homework for you
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
My table contains fields like (empId, empName,...)
And when I load my table to a DataGrid, the columns' titles become the sames as fields names in my table.
I need to assign them new titles (e.g. Employee ID, Employee Name, ...)
Anybody can help?
Mohamed Gouda
Egypt
|
|
|
|
|
|
Many Thanks
I expected more effort is needed for this. But it was so easy
Mohamed Gouda
Egypt
|
|
|
|
|
Hello ALL!
I have an xml file like this
<files>
<item>
<name>file1.mp3</name>
<seeks>
<seek>
<desc>First seek in first file</desc>
<pos>12</pos>
</seek>
<seek>
<desc>Second seek in first file</desc>
<pos>24</pos>
</seek>
<seek>
<desc>Third seek in first file</desc>
<pos>29</pos>
</seek>
</seeks>
</item>
<item>
<name>file2.mp3</name>
<seeks>
<seek>
<desc>First seek in second file</desc>
<pos>10</pos>
</seek>
<seek>
<desc>Second seek in second file</desc>
<pos>25</pos>
</seek>
</seeks>
</item>
</files>
and I have some mp3 files.
how can I play that files from 1st seek to 2nd seek ? information about seeks I will get from xml
thanx!
-- modified at 8:29 Thursday 5th July, 2007
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|
|
You need to check 'Ignore HTML tags in this message (good for code snippets)' for your XML to be properly rendered. The schema is irrelevant, however. You can use anything you like to play the mp3, be it DirectSound, the Windows Media Player control, etc. I don't believe any of those things offer the ability to play part of a track, but they all let you set the position in the track, so it's a case of setting a timer so you can stop it when the section ends.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|