DdoubleD 315 Posting Shark

If you are trying to references running assemblies outside of your application, you may wish to refer to this reading about application domains: AppDomain

DdoubleD 315 Posting Shark

If the class object is exposed (public) then you can use it. If it inherits from any non-exposed objects (not public) then you will not be able to use it.

Not sure if that answered your question because I don't know what you are trying to do, but it sounds like you might be trying to work with an assembly that is not referenced in your app. This article might help (dll or exe doesn't matter):Loading Assemblies at Runtime

DdoubleD 315 Posting Shark

Yes, how would I check for the version information inside of the application itself? And when the application finds an updated version, it will update itself.

String strVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

The version information it obtains is setup inside: AssemblyInfo.cs

DdoubleD 315 Posting Shark

If the class object is exposed (public) then you can use it. If it inherits from any non-exposed objects (not public) then you will not be able to use it.

DdoubleD 315 Posting Shark

Are you asking how to check for version information? If so, are you asking how to check it inside the application, or inside the setup/install?

DdoubleD 315 Posting Shark

Try this logic to setup each of your tables connection information. You will need to include using CrystalDecisions.CrystalReports.Engine

public void ViewReport(FileInfo crFileInfo) // path\filename.rpt
        {
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            crConnectionInfo.ServerName = "YOUR SERVER NAME";
            crConnectionInfo.DatabaseName = "YOUR DATABASE NAME";
            crConnectionInfo.UserID = "YOUR DATABASE USERNAME";
            crConnectionInfo.Password = "YOUR DATABASE PASSWORD";

            // CrystalReportViewer control
            crViewer.ReportSource = ReportSourceSetup(crFileInfo, crConnectionInfo);
            crViewer.Refresh();
        }

        ReportDocument ReportSourceSetup(FileInfo crFileInfo, ConnectionInfo crConnectionInfo)
        {
            ReportDocument crDoc = new ReportDocument();
            TableLogOnInfos crTableLogonInfos = new TableLogOnInfos();
            TableLogOnInfo crTableLogonInfo = new TableLogOnInfo();
            Tables crTables;

            crDoc.Load(crFileInfo.FullName);

            // Each table in report needs to have logoninfo setup:
            crTables = crDoc.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
            {
                crTableLogonInfo = crTable.LogOnInfo;
                crTableLogonInfo.ConnectionInfo = crConnectionInfo;
                crTable.ApplyLogOnInfo(crTableLogonInfo);
            }

            return crDoc;
        }
DdoubleD 315 Posting Shark

Understandably--it happens often--good luck!

DdoubleD 315 Posting Shark

Wrong Forum. You need to move this to one of the Web Programming forums--probably ASP.NET?

DdoubleD 315 Posting Shark

I've tried using ConnectionInfo for the report and for the tables etc in the code but it doesn't work.. Please help!!

You are on the right track. Post the code you are using for your ConnectionInfo so we can see what's missing.

DdoubleD 315 Posting Shark

If the controls are not available from the Tools tab in the IDE, then they are not installed and you would have to:

1) find custom controls already written and available for free: Custom Slider Controls, or
2) buy a third-party toolkit containing custom controls, or
3) write/create them yourself

I would suggest pursuing option #1 to start because there are many contributions available; checking out option #2 just to see what is being marketed; then proceeding to #3 if necessary or that suits you.

Please mark this as solved if your question is answered--thanks.:)

DdoubleD 315 Posting Shark

Be sure to use code tags because it makes it easier to read the code.

You are not passing in any parameters to the report in the code you gave. What are the names of the parameters defined in the report and what are their types?

DdoubleD 315 Posting Shark

hii...
:-/
can u plz get me out of the problem..!!!!1
m using visual studio 2005.
whenever i click an update button to update values of a particular column of a gridview, all the columns gets updated with the same values.
eg. if the 2nd column of 1st row with s.no. 1 is updated with values watch,50.,,,rest of the 2nd columns of rows with s.no.2,3,4,5 etc. also gets updated with these same values.

m using----

cmd.Parameters["s_no"].Value = ItemsGrid.DataKeys[(int)e.Item.ItemIndex];

cmd.Parameters["@s_no"].Value = ((TextBox)e.Item.Cells[0].Controls[0]).Text;

cmd.Parameters["@type"].Value = ((TextBox)e.Item.Cells[1].Controls[1]).Text;

cmd.Parameters["@item"].Value = ((TextBox)e.Item.Cells[2].Controls[1]).Text;

Hi Megha.Jain08! I see you found your way in here and got it posted--good! Sknake is an awesome programmer and gives excellent help.

Would you mind posting more of your code? It is not hard to see why you are getting all rows' column populated with the same values, but without seeing more of your code it is difficult to know how to guide you.

Cheers!

DdoubleD 315 Posting Shark

I am not getting th eoptions for Application that I should. These are my includes;

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using PsionTeklogix.Imager;
using System.IO;
using System.Text.RegularExpressions;

but when I type string appPath = Application. the choices are DoEvents, Equals, Exit, ReferenceEquals and Run.

Not sure why you don't get the Intellisense completion. The Application class is part of the System.Windows.Forms namespace. I assume you have the System.Windows.Forms.dll reference added too.

Have you defined your own Application class or namespace or something? Zip up your project and I'll take a look.

DdoubleD 315 Posting Shark

If you are still having trouble and you just want StreamReader to find the file in the app.exe folder, you can also obtain the exe's path via: Application.ExecutablePath .

Or, you would probably rather access:

Application.StartupPath

, which excludes the exe's filename...

DdoubleD 315 Posting Shark

The IDE creates a copy of the file in your "Text files" folder you added to the project. The "Copy to output directory" option says to copy a version of that one to the bin folder where the app.exe is placed. So, you shouldn't need to specify a path with the filename.

When you run your exe, the StreamReader should look for it in that folder if you omit the path from the filename. In other words, it will find the file in the current working directory. So, if you are running the exe from a different directory, it will NOT find it.

DdoubleD 315 Posting Shark

On the terminal, the executable is under My Device\Program Files\SmartDeviceProject1 and the sample.txt file is in My Device\Program Files\SmartDeviceProject1\Text files. Shouldn't I assume the starting path is My Device\Program Files\SmartDeviceProject1 ? I changed the line to

using (StreamReader sr = new StreamReader("..\\..\\Text Files\\sample.txt"))

but it still fails.

Sorry, see my other post. You don't need to specify a path at all...

DdoubleD 315 Posting Shark

Actually, now that I think about it, if you are using the option to copy to output directory, you don't need any path information. Just pass the file name: "sample.txt".

DdoubleD 315 Posting Shark

Your relative path is incorrect because it is checking from the bin folder where the app is running from. Try "..\\..\\Test files\\sample.txt" to get to the root of your project.

DdoubleD 315 Posting Shark

How you define arbitrary links is dependant on DB, Tool, and or app interface support. Here is a related link that shows how someone implemented similar in a RichTextBox: http://www.codeproject.com/KB/edit/RichTextBoxLinks.aspx
You could create a parser that formats your text accordingly prior to feeding it to the control.

DdoubleD 315 Posting Shark

Here is a decent link to Fun with Prime Numbers. I went ahead and converted the "The Array Method (Sieve of Eratosthenes)" code section to C# just for fun and to make sure it worked. Anyway, the article explains different approaches to finding primes--give it a shot then check back for help.

DdoubleD 315 Posting Shark

I have a message Box with two options, Retry or Cancel. Upon clicking cancel, I want to close the MessageBox and then load the main Form. Any idea how to do that? This function is already within a button_click function and I want to get out of this function and back to the Form_load.

void button_click(...)
{

dr=MessageBox.Show(.....);
if(dr== DialogResult.Cancel)
//exit the button and go back to the main form

}

The MessageBox call works fine in the Form_Load method. If you are wanting to cancel that form's creation at that point to return to the calling form (main form?), you can call Close() method after checking DialogResult.Cancel .

DdoubleD 315 Posting Shark

FYI: You can set the Tag property to your table for each treenode without having to use an owner drawn control. Are you planning to drag/drop from one TreeView to another?

DdoubleD 315 Posting Shark

I agree on that but, what I would like to add is, that you will never reach this bit:

available.Add(history[history.Count - 1]);
history.RemoveAt(history.Count - 1);

because you call your recursion function before these two lines are executed. So in order to fix this, you need to call your recursion function after the lines.

That's funny, because I stepped over those lines several times in the debugger. I'd like to hear exactly what it is that is trying to be achieved in this method because I'm not convinced those last two lines need to be there at all.

DdoubleD 315 Posting Shark

You are stuck in and endless loop because you keep adding to "available" following the recursive call. What is the objective here?

public void recursion(List<int> history, List<int> available)
        {
            if (available.Count == 0)
            {
                for (int i = 0; i < history.Count; i++)
                {
                    Console.Write(history[i].ToString() + "->");
                }
                Console.WriteLine(" ");
                return;
            }
            for (int i = 0; i < available.Count; i++)
            {
                history.Add(available[i]);
                available.RemoveAt(i);
                recursion(history, available);

                available.Add(history[history.Count - 1]);
                history.RemoveAt(history.Count - 1);



            }
            return;
        }
DdoubleD 315 Posting Shark

can u give me ur id so that i can explain u while u come in online

You should explain it in here because if I am unable to help you, someone else will if they understand what you are asking.:)

DdoubleD 315 Posting Shark

Is this program throwing an exception? I did a walkthrough and noticed you are using b[i] , but you never assign/initialize values. Also, b[i] values never get changed/updated that I can tell, so the result is always the same.

for (int i = 0; i < 5; i++)
            {
                if (b[i] == false)
                {
                    available.Add(place[i]);
                }
            }
DdoubleD 315 Posting Shark

hi.. thanks... can you understand the problem?.. If you could, can you please explain it to me? Thanks. the thing is, our prof don't want to tell what we should really do. Ouch. :(

What is not clear from your original quote is what the actual requirements of the assignment are. It seams like you original problem statement has both ideas and the problem mixed in and rather than ask a bunch of questions to find out what it is exactly you need to do, you should state that, then you could ask questions about ideas you have and for specific suggestions, etc.:)

DdoubleD 315 Posting Shark

Try using a BLOB for DB Field and use a MemoryStream for IO file transfer.

DdoubleD 315 Posting Shark

It's not clear by your description what you want us to do. You provided some code, and some sort of description of what it does, but not whether you want it to do something different, or you are getting an error, etc.

Please clarify how you want to be helped.

DdoubleD 315 Posting Shark

Welcome to C#! As far as I can tell so far, you need help understanding what your assignment is, and you are not ready to begin coding it in C# until you do understand that. I think you should contact professor or classmate to get a better understanding of the actual assignment first, begin coding what you can in C#, then begin asking C# questions if you need too.

ddanbe commented: Nice response! +8
serkan sendur commented: chic +7
DdoubleD 315 Posting Shark

If you are looking for a way to count all child nodes of each node, including children of any branches, then that it pretty easy. You just need a recursive method to do it.

It's hard to understand the logic of the relationships and the outcome of what you are doing. Maybe you can clarify it.

DdoubleD 315 Posting Shark

Look at this related subject: Mapping a byte array to a structure...

DdoubleD 315 Posting Shark

You probably want to move this thread to the following link, where they can also help you with the C# questions: http://www.daniweb.com/forums/forum18.html

DdoubleD 315 Posting Shark

OK, so you are constructing a string in C#.

string myString = "http://www.mywebsite.nl/test.php" + inputString;

// or, if input is coming from a control, like a textbox:

string myString = "http://www.mywebsite.nl/test.php" + textBox1.Text;

NOTE: I have not incorporated any symbols you might need in the Uri, like the "?", etc., but you can just add those in your assignment statement:

string s = "http://www.mywebsite.nl/test.php/?input=" + textBox1.Text

I am not a web programmer, so you will excuse me if I didn't construct a syntactically correct Uri string above.:P

DdoubleD 315 Posting Shark

A reference link to get you started: http://www.asp.net/ajax/

You can google for more information, so please mark this as solved. Also, there is an ASP.NET forum for Web Programming on Daniweb: http://www.daniweb.com/forums/forum18.html and for AJAX too: http://www.daniweb.com/forums/forum117.html

DdoubleD 315 Posting Shark
DdoubleD 315 Posting Shark

Is "input" a string and how is it obtained?

This might be more of a web programming question, which is probably why nobody has responded to your question yet, but go ahead and answer my question and we will see...

Also, please use code tags around your code.

DdoubleD 315 Posting Shark

Anyone, I am about to install the PHP binaries for Windows XP and IIS version VC9. On the PHP download page, the have thread safe and non-safe versions to choose. Why would I want to download the non-thread safe version?

Well, I opted for the non-thread safe version anyway because my machine runs slow enough and this is just for single user stuff I'm testing. I guess the performance hit must be severe enough if they maintain both versions.

DdoubleD 315 Posting Shark

Thanks for remembering maybach_hp--and bravo!

DdoubleD 315 Posting Shark

Oh, I hope someone can help you with that. You need to implement some sort of callback from the database load provided your db library supports that, which I think it probably does, but I don't know. What tool are you using for DB?

DdoubleD 315 Posting Shark

Here are a couple of other things to check/try:
- if the EXE you are referencing is also in your solution, make sure it built without errors.
- if it built OK, try deleting the reference to it in the module that won't build, then add the reference again. I've seen this problem before.

DdoubleD 315 Posting Shark

Do you have all the needed references added to the your assembly inherited by the class? When you say the inherited class is not exposed, do you mean by definition, or that you just can't see it when trying to use it?

DdoubleD 315 Posting Shark

Anyone, I am about to install the PHP binaries for Windows XP and IIS version VC9. On the PHP download page, the have thread safe and non-safe versions to choose. Why would I want to download the non-thread safe version?

To install IIS on Windows XP, make sure you have Windows XP Pro edition. Goto

control panel -> add remove programs, select windows component.

From the list, check Internet Information Services (IIS) and click next. Make sure windows installation CD is in the CDROM.

Once you have installed IIS, goto php.net and download the binaries for windows with installer. Run the file and it will guide you through rest of the process.

DdoubleD 315 Posting Shark

also note that one these accessible classes is a child of another unexposed class.

Are you saying that you are trying to access a class that is inside of another class that is not exposed? Because that sort of explains the problem. To expose the "child class definition", you could move that outside of the unexposed class.

If that's not the problem and I have misunderstood, try using the fully qualified name: namespace.class.member , build and submit the complete error text generated.

DdoubleD 315 Posting Shark

Something else to check: if trying to access a static method, it needs to be proceeded by the class name: TheClassName.MethodName()

DdoubleD 315 Posting Shark

I've exposed objects from an EXE before and not had this problem. Can you attach one of the smaller file objects that is not properly exposing itself to modules referencing the EXE?

Also, have you verified the object that is not getting exposed is using the namespace you are expecting?

DdoubleD 315 Posting Shark

If you are talking about the IE window that get's opened with VS, click on the Search tab and look for a panel on the right. Mine gives choices:
1) Local
2) Online
3) Codezone
4) Questions

I think it defaults to whatever you last used, but I'm not sure.

DdoubleD 315 Posting Shark

Yes, it is similar to using %d or %l in C. Each enclosing numbered brace indicates it is a placeholder for the next parameter. Here is a good link on the construction of the format: http://msdn.microsoft.com/en-us/library/txafckwd.aspx

DdoubleD 315 Posting Shark

Here is a link to fairly good article on creating a custom UserControl for a ProgressBar: http://support.microsoft.com/kb/323116

It's straightforward and I like the way the introduction gives a clear depiction of the usage as well as the step-by-step approach to creating it in VS.

DdoubleD 315 Posting Shark

.i just used www.google.com to find the answers ,didn't know them until I did! -)

LOL--smarty. I tried a quick search and didn't find it, then realized, "Hey, I bet somebody on this website knows." Anyway, I appreciate your time--thanks!