|
I want my application wether it Windows or web to open a given website (applet or any) and read (to file or DB ) what its displayed on it win i run it,
i just want to know haw to doit,
please HELP ASAP
Thanks Alot
|
|
|
|
|
Hi,
I'm very new to the C# application development architecture. What I am trying to accomplish is a class-system that looks a lot like the class system C++ is providing. An example of this architecture would be something like earth - an environment with animals and plants. Animals feeds the plants, and the plants lets the animals spread their seeds. They need eachother in order to function properly. What they need as well though, is a base - somewhere to walk. This is where "an Earth" come in to the picture. Earth sends parameters to the plants and animals, which handles the parameters, does what they have to do, and returns the result to earth - which continues sending requests and demands.
This is it.
I want an application where I might converse between classes without sending them as attributes all the time. Right now I'm having abstract classes which handles requests and demands from the Main Form and returns the result. It's very clumsy, since I have to send all fields that is beeing worked with as a parameter to the static function.
Is it somehow possible to set important fields to absolutly public? Or am I fishing in the wrong waters - are my idea of the optimal architecture incorrect?
I appreciate all answers I'll get. Thank you in advance,
// Leo
|
|
|
|
|
Zanathel wrote:
Is it somehow possible to set important fields to absolutly public? Or am I fishing in the wrong waters - are my idea of the optimal architecture incorrect?
Having everything public is NOT good architecture....
First the bad news - stuff C++ does that you can't do here. Two things spring to mind - no multiple inheritance and no friend classes.
You simulate multiple inheritance through interfaces, you can have a base class and impliment as many interfaces as you like. I find when I use C++ now, I tend to create classes to mimic the interface concept, it's not so bad.
No friend classes is a PITA though. There's really no way around this that I can see.
Zanathel wrote:
want an application where I might converse between classes without sending them as attributes all the time.
The good news is that you have delegates to send messages between classes now, which come in very handy, very often. You should look into using them to define communication between classes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have an application that I need to verify local user accounts against. I'm having a hell of a time finding information on this. I have found that the local windows account passwords are encrypted and I've got some direction on the cypher, but nothing on how to access it. So for example, I have accounts Admin, Ed and Erin. If someone tries to login as admin I need to verify their password against the local machine admin account. Any suggestions? Thanks.
Ed
|
|
|
|
|
I have an application that I need to verify local user accounts against. I'm having a hell of a time finding information on this. I have found that the local windows account passwords are encrypted and I've got some direction on the cypher, but nothing on how to access it. So for example, I have accounts Admin, Ed and Erin. If someone tries to login as admin I need to verify their password against the local machine admin account. Any suggestions? Thanks.
|
|
|
|
|
Hello, I am developing an application that uses SqlServer and Crystal Reports, and I'm having some trouble when deploying the application. Because the sql servers on my development machine and in the client machine have different names.
So I created an app.config file, and saved there the name of the server. For non-crystal reports operation everything is fine, I just have to change the name of the server in the app.config, but how can I dinamically change the name of the server for a crystal report .
Thanks in advance for any answers.
|
|
|
|
|
Use one dataset for creating the crystal report.
// connection string from app.config file
con.ConnectionString=c.g_strConnection;
// filling the dataset
adapt.Fill(dsBatch);
// creating an object of the crystalreport
crBatchSummary crObj=new crBatchSummary();
crObj.PrintOptions.PaperOrientation=PaperOrientation.Landscape;
crObj.PrintOptions.PaperSize=CrystalDecisions.Shared.PaperSize.PaperA4;
// setting the datasource of the crystal report
crObj.SetDataSource(dsBatch);
// Assigning crystal report object to the crystalreportviewer
crvBatch.ReportSource=crObj;
Ammu
|
|
|
|
|
Hi
In design time , create the Dataadapter & dataset.
Then create a new Crystal report and select the datasource as
projectdata -> ADO Datasets -> Dataset name.
Then all the columns will appear in the field list and you can design the report.
In code behind file , write the codes mentioned before.
hope this will clarify ur doubt..
Ammu
|
|
|
|
|
I need to create a kind of splitter better of the default.
So i would to start from a panel.
But i would to became the panel during the moving semi-transparent, just like the splitter if moved.
How could i do?
|
|
|
|
|
I'm putting together my first C# database application. It compiles fine and seems to be connecting to my database fine, but when I create the command I get the following error:
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
This is the line VS claims is causing the error:
this.cmdGetNewClients = new System.Data.OleDb.OleDbCommand();
The code around it is:
this.cn.Open();
this.cmdGetNewClients = new System.Data.OleDb.OleDbCommand();
cmdGetNewClients.CommandText = @"SELECT ClientName FROM Clients";
cmdGetNewClients.Connection = this.cn;
OleDbDataReader rdr = cmdGetNewClients.ExecuteReader();
while(rdr.Read())
newClients.Add(rdr["[Client Name]"]);
rdr.Close();
cn.Close();
Can anyone tellme why I'm getting this error and how to fix it?\
Thanks!
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
The error is too general. Wrap the code in a try catch block and see what the true error is.
If you catch and exception of type SqlException you can try this:
foreach(SqlError err in sqlEx.Errors)
Console.Writeline(e.Message);
Otherwise just check the InnerException. It could be something simple like a login issue.
|
|
|
|
|
Thanks for the advice, can you give me a hand writing the try/catch though? I'm afraid I'm a bit new to C# and rusty in the other stuff I knew in college.
it would go something like this:
try
{
this.cmdGetNewClients = new System.Data.OleDb.OleDbCommand();
}
catch()
{
foreach(SqlError err in sqlEx.Errors)
console.WriteLine(e.Message);
}
What goes in the catch()?
Thanks so much for helping.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Try something like this:
try
{
//insert your code here
}
catch(OleDbException ex)
{
Console.WriteLine("Message: " + ex.Message + "\n");
if(ex.InnerException != null)
Console.WriteLine("Message: " + ex.InnerException.Message + "\n");
foreach(OleDbError e in ex.Errors)
Console.WriteLine(e.Message + "\n");
}
|
|
|
|
|
OK, I got that coded in, but it doesn't seem to be actually catching the error. It's highlighting the lind of code inside the try, but it's still saying it's an "unhandled exception" and I'm not getting any console output.
What gives now?
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
Possibly a typo in your post, but...
you select a field named [ClientName] (no space)
then try to get the field value from [Client Name] (space btwn Client & Name)
no such field exists in the readr, so an exception is thrown.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Thanks for spotting that. It was actually an error in the code (I'd renamed the field and forgotten to update all references to it), but it's not causing the error. The code doesn't even get that far.
The ends can never justify the means. It is the means that determine the ends.
|
|
|
|
|
I took your code and for the most part is worked ok. I filled in some of the blanks and got this code to complie and run:
OleDbConnection cn = new OleDbConnection("User ID=xxx;Password=xxx;Initial Catalog=Northwind;Data Source=192.168.0.1;Provider=SQLOLEDB");
cn.Open();
System.Data.OleDb.OleDbCommand cmdGetNewClients = new System.Data.OleDb.OleDbCommand();
cmdGetNewClients.CommandText = @"SELECT LastName FROM Employees";
cmdGetNewClients.Connection = cn;
OleDbDataReader rdr = cmdGetNewClients.ExecuteReader();
ArrayList newClients = new ArrayList();
while(rdr.Read())
newClients.Add(rdr["LastName"]); <-- change made here
rdr.Close();
cn.Close();
Good luck.
|
|
|
|
|
Maybe you are forgetting to set the connection string in the OleDbConnection object.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello All,
I Lunch a form from another form how can i refresh the Firest form after I click button on the second form.
Regards
Hay
|
|
|
|
|
if you launch the second form from the first one you can add the first form in de constructor of the second. Something like
private Form m_form1<br />
<br />
public Form2(Form form1)<br />
{<br />
m_form1 = form1<br />
}<br />
<br />
your button click would be someting like:<br />
<br />
<code>private void HandleClick()<br />
{<br />
m_form1.Refresh();<br />
}<br />
<br />
basically you can call any public method in form1.<br />
<br />
Other more advanced option is to use the observer pattern. You can google for observer and c# to get more info on that subject.<br />
<br />
<br />
|
|
|
|
|
Hello,
I have a datagrid:
this.dataGridRevenues.DataMember = "LotYields";
this.dataGridRevenues.DataSource = this.dataset;
is there a way to display only certain rows in the grid, when loading the
dataset?
Thank you.
|
|
|
|
|
Try this
this.dataset.Tables("Products").Columns("Name").ColumnMapping = MappingType.Hidden
Alomgir Miah
Live Life King Size
|
|
|
|
|
Hello,
If you want to display specific rows based on the values they contain, you can create a DataView, and set the RowFilter property. Then bind the Datagrid to the DataView.
|
|
|
|
|
you can also create your select statement to only return the rows you want. Which to me would seem to be the easiest.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Hello,
I'm writing a little class that hooks up a list view to display the selection count in the status bar. It's working great except that I found one little problem: in one of my forms, I have a tree control on the left, and a list view on the right. If I select another item in the tree, the list view is cleared and filled again with some other items (unselected, of course), but I never get the SelectedIndexChanged event.
Is there anyway I could detect when a new item is added and just update the count display? The only restriction is that I can't modify existing code.
Any ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|