|
Hi guys,
I need some help please, I am a newbie with C# and I am stuck on something.
I am using dataset to get data from the database, here is some bits of my code
SqlDataAdapter adp= new SqlDataAdapter();
DataSet ds=new DataSet();
adp.Fill(ds,"tbACJE");
if(ds.Tables["tbACJE"].Rows.Count>1)
{
System.Data.DataRow rd= ds.Tables["tbACJE"].Rows[0];
Double fTemp= 0.0;
fTemp=double.Parse(ds.Tables["tbACJE"].Compute("SUM(rd[0] + rd[1])", "").ToString());
What I am trying to do is
1) if there are more than 1 rows get the sum of the first 2 columns and if it's zero than Message and if not zero than get the difference amount.
Please help???
sasa
|
|
|
|
|
Hi
I'm using function in a dll written in C++ / MFC Visual Studio 6.
This use to work fine in the .NET framework 1.1, but I upgraded to Visual Studio 2005 and when I use any function from the dll I get a message 'LoaderLock was detected'. Are there any work around without changing the API?
Cheers Johan
|
|
|
|
|
What does that Dll do exactly?
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
|
GOD BLESS U
Hai
Difference betweeen .Dll and .exe files in .netplease give atleast 6 to 10 diferences)
thank u 4 ur kind support
bye 4 now
arun
|
|
|
|
|
Are writing a test? It sounds very much like that.
In that case, shame on you for trying to fool people into helping you passing a test that you don't have sufficient knowledge to pass on your own.
---
b { font-weight: normal; }
|
|
|
|
|
a dll file has an extension of ".DLL" and an exe has an extension of ".EXE"
Xorry, couldn't resist
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hey, that's clever!
But could we imagine a dll with the extension .exe and vice-versa?
hehe...
sorry, I couldn't resist either!
|
|
|
|
|
Hello,
How can I make a search that do not only find the exact match but also similiar matches with xpath ?
For example,
our xml fragment is -lets say- like this :
<br />
<ROOT><br />
<DATA attribute1 = "123" attribute2 = "987"><br />
<AA> something here </AA><br />
<AB> again something here </AB><br />
</DATA><br />
<DATA attribute1 = "abc" attribute2 = "def"><br />
<BA> 123 </BA><br />
<BB> 987 </BB><br />
</DATA><br />
</ROOT><br />
..and I want to make a search to find all DATA's that contains the string "23" anywhere (at its attributes, childs, childs' attributes etc.
So after my search I will find the first DATA element (because its attribut1 is 123 and this contains 23) and also the second DATA element (because its BA child's value is 123 which contains 23).
Can I do this using xpath (I haven't find any SQL like "like" method under xpath) or may I choose another strategy?
.:: Something is Wrong ::.
|
|
|
|
|
You Must Load Youre Data To dataset Or dataView and then Search with Youre Cretria ;
MHF
|
|
|
|
|
may I use sql like select statements and complex queries in this dataset ?
also how can I acces element attributes through this dataset
.:: Something is Wrong ::.
|
|
|
|
|
DataTable Have Select Method You can use it
But for Complex Queries you must write a class or function that use that
Search in the internet mybe Find some codes
MHF
-- modified at 10:13 Tuesday 15th August, 2006
|
|
|
|
|
pashje wrote: Can I do this using xpath (I haven't find any SQL like "like" method under xpath) or may I choose another strategy?
yes you should
XmlDocument doc = new XmlDocument()
doc.Load(filename);
XmlNodeList list = doc.SelectNodes("//DATA@[your argusments here]");
I suggest grabbing the old book "XML in a nutshell". You need to know a few commands for xpath to get this to work.
Then just to a foreach on the XmlNodeList
foreach(XmlNode node in list){}
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
contains would be the most useful function in this case
XmlNodeList list = doc.SelectNodes("//DATA[contains(.,'123')]");
only two letters away from being an asset
|
|
|
|
|
i create a application in c#, and i want to call other program such as program in namespace 1 call program in namespace 2 , anybody can help?
-- modified at 8:18 Monday 14th August, 2006
|
|
|
|
|
Calculator will launch by this.
System.Diagnostics.Process.Start("calc.exe");
|
|
|
|
|
I'm experimenting with a very basic .Net remoting client server i wanted to make sure i could get it to work before trying something more complex the client server works fine locally i.e. with both server and client on the same machine however when going between two different computers which are local on the network it doesn't work i get a message simmilar to unable to connect to remote server or something to that effect the configuration files are below:
<CLIENT>
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="GPSWaypathData, GPSWaypathData" url="tcp://10.34.144.109:8989/GPSWaypathData" />
</client>
</application>
</system.runtime.remoting>
</configuration>
<SERVER>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="GPSWaypathData, GPSWaypathData" objectUri="GPSWaypathData" />
</service>
<channels>
<channel ref="tcp" port="8989" />
</channels>
</application>
</system.runtime.remoting>
</configuration>
Any help would be really apreciated
-- modified at 8:02 Monday 14th August, 2006
|
|
|
|
|
Did you check the firewall settings (Control Panel->Windows Firewall) on the server? It is possible that port 8989 is blocked for incoming traffic. You could try explicitly adding the port to the Exceptions list.
|
|
|
|
|
No theres no firewall in place between either of the computers
|
|
|
|
|
I meant the firewall built into Windows.
Try running netstat -a on the command line to check if the server is running on the port you specified. To check whether the server is reachable from the client, try running "telnet <server ip=""> <port no="">" and see if it connects.
|
|
|
|
|
Hi
Is there Any ApI Function that Give the Current resulation of Windows ??
With Thanks....-><-
MHF
|
|
|
|
|
Try the Screen.PrimaryScreen.Height and Screen.PrimaryScreen.Width properties.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
thanks this Screen.PrimaryScreen.Bounds.Width work
MHF
|
|
|
|
|
Hi to all,
it's urgent.
I know how to build a DirectShow FilterGraph in VC++6, but I dont know it in C#.
How to build a DirectShow FilterGraph in C#?
How to find a Register Filter (in IBaseFilter Interface) using it's name?
How to Connect pins of 2 filters?
If possible explain with example.
please help me.
Thanks & Regards,
Aniket Salunkhe
-- modified at 7:04 Monday 14th August, 2006
|
|
|
|
|
This is a follow on question from:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&XtraIDs=1649&searchkw=hodges&sd=5%2F16%2F2006&ed=8%2F14%2F2006&select=1619517&df=100&noise=5&mpp=50&fr=319#xx1619517xx
I have been able to populate a context menu with data from a database. However I now have the problem of working out which item has been selected from the menu.
This is the code that adds the items to the menu:
private void addPersonalPhonebookItem(string name, string number)<br />
{<br />
ToolStripMenuItem personal = ts_phonebook_personal;<br />
ToolStripMenuItem personalMenuItem = new ToolStripMenuItem();<br />
<br />
personalMenuItem.Name = name;<br />
personalMenuItem.Text = name + " (" + number + ")";<br />
personalMenuItem.Click +=new EventHandler(phonebookMenuItem_Click);<br />
personalMenuItem.Tag = name + number;<br />
personal.DropDown.Items.Add(personalMenuItem);<br />
}<br />
And this is the EventHandler:
void phonebookMenuItem_Click(object sender, EventArgs e)<br />
{<br />
MessageBox.Show("You Just Clicked: " + e.ToString());<br />
}<br />
How do I get the 'name' or 'number' of the clicked item...
Thanks again in advance,
Phil
|
|
|
|