|
hi,
i have a datagrid displaying a database,
i want to use certain cell values to for example make a sum, the result i want to display on a second datagrid in a specified cell for example column 2 row 3
im not sure how to do this
my first thought is to somehow copy the database showing on the first grid an use these to calculate.
any tips on how i shoud get this working?
thx
|
|
|
|
|
Are there any API's for interacting with Bluetooth devices using C#.NET 2.0 (Desktop).
Is there any guide/tutorial/book out there that deals with this subject?
Here's what I want to end up being able to do - I have a bluetooth USB device and I want to communicate with it using C# 2.0
Any sort of help would be greatly appreciated.
There is no patch for ignorance
|
|
|
|
|
Hi, How do I create a comma delimited text file and write data from SQL database in it using C#?
|
|
|
|
|
The System.IO.File class has all you need to create a file. Not sure if there are any APIs apart from reading your table and writing it out with commas added.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have an MDI in which on the left side is a tree view, and on the right side, i have forms. I open those forms upon selection of nodes from the tree. Now i have a form on the right-side in which i have some buttons. I want that when i click on a button, a relevant tree node can be selected and also the form related to that node can be opened on the right side.
Can anyone guide me how can i do that?
sAqIb
|
|
|
|
|
I have an MDI in which on the left side is a tree view, and on the right side, i have forms. I open those forms upon selection of nodes from the tree. Now i have a form on the right-side in which i have some buttons. I want that when i click on a button, a relevant tree node can be selected and also the form related to that node can be opened on the right side.
Can anyone tell me how can i do that?
sAqIb
|
|
|
|
|
Good morning, I would like to know if it is possible to use a streamwriter and write user input (string) to a specific cell in a worksheet in excel. If not a streamwriter, is there another class that might be able to do it ? Im not talking about writing comma delimeted files which you can open in excel, i want to write a string directly to an excel worksheet to a specific cell so that i can use the formulas created in it.
Any help will be appreciated.
Thank you.
|
|
|
|
|
You can control Excel via COM, and newer versions via a .NET library.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi every one,
i write one application in that application i used one xmlfile(path is "c:\doc\xmlfile.xml"),
now i send my exe to another system and also xmlfile.
now i will put my xmlfile where my exe is loaded in the system.
how can i access the exe path at runtime in c#.net
plz help me .
|
|
|
|
|
Hi,
Try using
Application.StartupPath . It gives you the path of the current application.
Hope it helps.
Do your best to be the best
|
|
|
|
|
Thanks,
i got the path os exe
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
Thanks,
i got the path the exe
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
Thanks,
i got the path of exe
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
be thankful is good , but not more than usual !!! ;)
|
|
|
|
|
Iv been trying to learn the A* pathfinding algorithm. I think I got it down but im having a problem with my implimitation. The problem is that the path is very sloppy. It will not make a diagonal move when it is supposed to and so on. The path looks like it was drawn by a 3 year old. I have beat my head against the wall on this and I am so sick of it, I just want it to work. I have done everything the way its supposed to be done, Iv even looked at some pathfinding articals here. Im using a heavily modified version of an algorithm I downlaoded from this site. Here is the code for the core of the algorithm for which I belive the problem exists.
using System;
using System.Collections.Generic;
namespace PathFinding
{
public class SimplePathFinder
{
Map nodeMap;
Node startNode;
Node endNode;
Queue<Node> finalPath = new Queue<Node>();
bool isPathFound;
public bool this[int x, int y]
{
get { return nodeMap[(ushort)x, (ushort)y]; }
set
{
nodeMap[(ushort)x, (ushort)y] = value;
isPathFound = false;
}
}
public Coordinate StartNodePositon
{
get { return new Coordinate(startNode.X, startNode.Y); }
set
{
startNode.X = (ushort)value.X;
startNode.Y = (ushort)value.Y;
isPathFound = false;
}
}
public Coordinate EndNodePositon
{
get { return new Coordinate(endNode.X, endNode.Y); }
set
{
endNode.X = (ushort)value.X;
endNode.Y = (ushort)value.Y;
isPathFound = false;
}
}
public Coordinate[] Path
{
get
{
if (!isPathFound)
FindPath();
if (finalPath.Count == 0)
throw new ApplicationException("Path not found, the start node or the end node is enclosed or do not exist.");
Stack<Coordinate> coordinateStack = new Stack<Coordinate>();
foreach (Node pathNode in finalPath)
{
coordinateStack.Push(new Coordinate(pathNode.X, pathNode.Y));
}
return coordinateStack.ToArray();
}
}
public SimplePathFinder(int width, int height, Coordinate startNodePos,
Coordinate endNodePos, Coordinate[] unwalkableNodes)
{
nodeMap = new Map((ushort)width, (ushort)height, unwalkableNodes);
endNode = new Node(null, null, nodeMap, endNodePos.X, endNodePos.Y);
startNode = new Node(null, endNode, nodeMap, startNodePos.X, startNodePos.Y);
}
void FindPath()
{
SortedNodeList Open = new SortedNodeList();
SortedNodeList Closed = new SortedNodeList();
if (startNode == null || endNode == null || nodeMap == null)
throw new ApplicationException("StartNodePosition, EndNodePosition, or the Map is not instantiated.");
Open.Push(startNode);
while (Open.Count > 0)
{
Node currentNode = Open.Pop();
if (currentNode.Equals(endNode))
{
endNode.ParentNode = currentNode.ParentNode;
break;
}
Node[] successors = currentNode.GetSuccessors();
foreach (Node successorNode in successors)
{
int oFound = Open.IndexOf(successorNode);
if(oFound > 0)
{
if (Open.NodeAt(oFound).CompareTo(currentNode) <= 0)
continue;
}
int cFound = Closed.IndexOf(successorNode);
if (cFound > 0)
{
if (Closed.NodeAt(cFound).CompareTo(currentNode) <= 0)
continue;
}
if (oFound >= 0)
Open.RemoveAt(oFound);
if (cFound >= 0)
Closed.RemoveAt(cFound);
Open.Push(successorNode);
}
Closed.Push(currentNode);
}
Node p = endNode;
while (p != null)
{
finalPath.Enqueue(p);
p = p.ParentNode;
}
if (finalPath.Count == 1)
finalPath.Clear();
isPathFound = true;
}
}
}
If you need the whole project let me know, I would greatly appreciate any help.
static int Sqrt(int x) { if (x<0) throw new ArgumentOutOfRangeException(); int temp, y=0, b=0x8000, bshft=15, v=x; do { if (v>=(temp=(y<<1)+b<<bshft--)) {="" y+="b;" v-="temp;" }="" while="" ((b="">>=1)>0); return y;
|
|
|
|
|
I have a xml file organized like this:
BlackBox Version="1.0"
MainForm Name="frmMain" Value="WillnessLabs BlackBox"
Control Name="label1" Value="Test label"
Control Name="button1" Value="Test button"
Control Name="tabPage1" Value="Test tab1"
Control Name="tabPage2" Value="Test tab2"
MainForm>
MainForm Name="frmOptions" Value="My beloved options"
Control Name="label1" Value="Test label"
MainForm>
BlackBox
And I use this code below, to find the control on the form and to set the value to it...
string name, value;
nav = doc.CreateNavigator();
node = nav.Select("/BlackBox/MainForm[@Name='frmMain']");
while (node.MoveNext())
{
name = node.Current.GetAttribute("Name", "");
value = node.Current.GetAttribute("Value", "");
FindControl(form, name).Text = value;
}
It works like a charm if the xpath expression is "/BlackBox/MainForm/node()".
But if I want to run xpath expression like this "/BlackBox/MainForm[@Name='frmMain']" to load just nodes for the current form
the user is on, so I don't need to load those for options, I get an error.
Object not set to an instance of an object.
What Iam doing wrong? Is xpath expression good? What expression do I need to get this done?
|
|
|
|
|
When you restrict the XPath expression for one form you still have to state that you want all the children of the context node: "/BlackBox/MainForm[@Name='frmMain']/node()" With your current expression you only select the MainForm node.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
This is it. Thank you...
So close, but yet so far away...
|
|
|
|
|
Hi guys, this is my first time to post here. I am thinking of developing a windows application for voice chat, which can be used to chat with voice in a LAN. I’m doing this as my final year project of my undergraduate studies and I’m planning to develop this using C#, but I am not that much familiar with C# or its voice and transmission libraries or classes (I only did a small project using ASP.NET/C# before). So if there is any one up there who has any idea or books about voice chat, please reply. I’m looking for anything on this subject.
I will be waiting guys……………
We should learn to share
|
|
|
|
|
Hi,
If you need to develop the application with SpeechRecognition you need to use Speech SDK. Here [^] you can find an example of how to use Speech SDK 5.1.
If you want to send a sound files over the network that you can use Sockets. You can use [^] as an example.
Hope it helps
Do your best to be the best
|
|
|
|
|
Heay, Thanks for replying, the socket part was realy helpfull
To be brief on my project, I’m thinking of doing an application like “SKYPE” or “ Yahoo messenger with voice” but it doesn’t have to work on the Internet it is okay if it works only on the LAN. So that it can help someone to call and talk to someone else on the LAN using a headset, a Mic and this running on his PC.
I heard someone did this once in Java using socket programming so I’m looking for books on socket programming too but now I’m just reading C# books. So man, if u come across of any more ideas/books on this please let me know.
We should learn to share
|
|
|
|
|
Hi,
I am trying to create and then use a VC++ DLL in C#. I created the DLL in Visual Studio 2005. I just built the dll without adding any function of mine to it. That is, it is a dll that exports symbols and has the following pre-defined export symbols/functions.
// This is an example of an exported variable
TEST_API int ntest=0;
// This is an example of an exported function.
TEST_API int fntest(void)
{
return 42;
}
where,
#define TEST_API __declspec(dllexport)
Then I created a simple VC# empty project ( in Visual Studio 2005) and added the class "test" to it. When I add the VC++ dll as a reference I get this error .... "A reference to "../test.dll" could not be added. Please make sure that the file is accessible, that it is a valid assembly or COM component".
Even though I dont think it needs a conversion from COM to COM+, I even tried doing "tlbimp". I went to the command prompt for Visual Studio 2005, followed the path to where my dll resides and used the tlbimp command. But I got the error that test.dll is not a valid type library.
Someone told me that I need to register the dll using regsrv32 and it would show in my COM list when I am adding it as a reference. But that didnt work either. When I run the regsrv32, I get the error message as "..\test.dll was loaded, but the DLLRegisterServer entry point was not found" ...
I just want to know that what is it that I am doing wrong? Is there something else that I should be doing ?
All I did for creating the test.dll was ...... I went to File->New->Project. Under Visual C++ I selected Win32 and then Win32 Project. In the Application settings I selected the DLL and then checked the export symbol box. I simply built the project and was trying to use it.
Thanks for your time.
Saania
|
|
|
|
|
I just answered this, did you cross post, or was my reply lost ?
It's not a COM dll, so regsvr won't work. You need to make it a COM dll, make it a managed DLL, or use p/invoke to call it's methods from C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yeah thanks once again, I posted it in 2 different threads.... The point I didnot mention in the other reply is that I am using PInvoke in C#. That is where I started from, and when that didnt work I had to look into what other stuff could be wrong.
I am using ...
[System.Runtime.InteropServices.DllImport("testdll.dll")]
static extern int fntest ();
and in the main I am simply doing ....
int x = fntest ();
and this is where I get the error ... EntryPointNotFound exception. It says "unable to find entry point named "fntest" in DLL "testdll.dll". I even tried using System.Reflection.Assembly.Load Method, which throughs a TypeLoadException.
Please help me out here. I would highly appreciate it.
Thanks,
|
|
|
|
|
A C++ dll contains an export file, which is just a text file that lists the methods that are exported. I suspect that's what you need here.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|