|
Wow, I've tried it and it makes Windows Form Applications much easier to make. It's a lot better than guessing the x and y values for every single control...
Paul Conrad wrote: Maybe you can change your sig about not having VS
Well maybe you should've looked at the last line of the message you just quoted...
If I had a sig, it would probably go here.
|
|
|
|
|
Gz!
Now finally you can start developing like decent people do
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
So you're saying I'm not decent?
If I had a sig, it would probably go here.
|
|
|
|
|
Please take a look here.[^]
The smiley should have been hint enough.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
|
I want that create and print report with c#
but i want do every thing by code and don't use any option in visual studio
please help me
|
|
|
|
|
What part, specificly, are you having trouble with?
I get all the "news" I need from the weather report.
|
|
|
|
|
i just write this code in class named BindReport
public DataSet GetDataSet()
{
SqlConnection sqlconn = new SqlConnection(_connectstring);
SqlDataAdapter DA = new SqlDataAdapter("select aman_no,aman_name,aman_area from aman", sqlconn);
DataSet ds = new DataSet();
DA.Fill(ds,"aman");
return (ds);
}
and this code in form load
BindReport obj = new BindReport();
DataSet ds = obj.GetDataSet();
CrystalDecisions.CrystalReports.Engine.ReportDocument myRPTDocu = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
myRPTDocu.Load(@"..\..\CrystalReport2.rpt");
myRPTDocu.SetDataSource(ds);
crystalReportViewer1.ReportSource = myRPTDocu;
and this code not work and give me exception "the report has no tables"
|
|
|
|
|
Hi,
I have the following situation and struggling with it. So hopefully someone can solve it or perhaps advice me another method. What I have is an Excel spreadsheet and a c# program.
In the program i load the excelsheet into a datatable
<br />
Cursor = Cursors.WaitCursor;<br />
InitExcel(ref _exr);<br />
_dt = _exr.GetTable();<br />
So far so good. I can than loop trough the rows from the datatable like this
foreach (DataRow da in _dt.Rows)<br />
{
and so on. What i would like to achive now is the following. In my datatable there are many rows. I would like to group rows where a certain column has the same value. It is a fact that rows where this is the case are underneath each other. So it thought lets move to the next row to see if the value is the same. if so read some columns and move on to the next row and do the same check. If the value is the same read the samen columns. If not i have another row and start over again. The result should than look something like
Source table
100;Nice product;100.0;Variant 0
100;Nice product;100.1;Variant 1
100;Nice product;100.2;Variant 2
200;Another nice product;200.0;Variant 0
200;Another nice product;200.1;Variant 1
200;Another nice product;200.2;Variant 2
100 Nice product
....100.0 Variant 0
....100.1 Variant 1
....100.2 Variant 2
200 Another nice product
....200.0 Variant 0
....200.1 Variant 1
....200.2 Varian 2
and so one. but i have not got a clue how to do this. I cannot figure this out. A bad but working solution is to add the datatable to a hidden grid on the form and perform this actions on the grid. but that is not the solution i am looking for
Hope this makes any sense and that someone can help me solve this issue
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
in datatable u have a function called select(query)
u can use that will solve ur problem
it will get the collection of rows having the same column value and returnit as a row[].
ex
---
DataTable table = DataSet1.Tables["Orders"];
// Presuming the DataTable has a column named Date.
string expression;
expression = "Date > #1/1/00#";
DataRow[] foundRows;
// Use the Select method to find all rows matching the filter.
foundRows = table.Select(expression);
// Print column 0 of each returned row.
for(int i = 0; i < foundRows.Length; i ++)
{
Console.WriteLine(foundRows[i][0]);
}
}
with Regards
Amjath
|
|
|
|
|
Thanks Amjath,
this one works exellent for my. Sometimes the solution is simple
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
I'm getting this error, any idea why?
Error:
'DerivedClass': member names cannot be the same as their enclosing type
Code:
using System;
namespace TestConsole
{
public class TestOne
{
public static void Main()
{
}
}
public class PersonDetails
{
private string foreName;
//read only property because it only has a 'get' clause
public string ForeName
{
get
{
return foreName;
}
}
protected void SetForeName(string value) {
foreName = value;
}
}
public class DerivedClass : PersonDetails
{
public DerivedClass() {
base.SetForeName("Joey"); } //error
}
}
Jon
|
|
|
|
|
Hi Jon,
the code shown seems correct. If it actually is what is in your project,
I suggest you close Visual, reopen it and retry (with Rebuild Solution, so it
throws away all existing output files).
|
|
|
|
|
Cheers for that
Jon
|
|
|
|
|
Hi!
The code you have posted is correct and can be compiled without problems.
Please try again or post the code that's actually giving the error.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Change the name of the base class method "SetForeName" to something other than that. Its the cause of your exception.
Phil
|
|
|
|
|
It's not being compiled with VS2005 somehow....that's where the problem is
Jon
|
|
|
|
|
Did it compile now after restarting VS, like Luc suggested?
All I can tell you is that exactly the code you posted can be compiled just fine on my PC with VS2005. So either you didn't post the exact code or your C# compiler is screwed up in a very strange way...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi im working on an application to update a flash website , ive made a form with a WebBrowser control which im using as a local preview .
Im trying to figure out why the preview isnt working correctly , my onclick events arent working and it isnt importing the images correctly .
it works fine in ie but im getting ie script errors in the program which is weird because its scope is set to a swf
Is their any way to get this preview working
|
|
|
|
|
I want to create a windows form localized to Amharic language(Ethiopia). What is the use of UTF8 Files with localization? i have got some am_ET.UTF8 File, is there any thing related to this and may help localizing applications created using C#?
Anyone with know how, please let me know.
|
|
|
|
|
I've never really dealt with localization since many of my projects are for client internal use locally here in the US. Have you looked at any localization articles on this site? If I recall, there are some pretty good ones
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Yegojjam Lij wrote: i have got some am_ET.UTF8 File, is there any thing related to this and may help localizing applications created using C#?
http://www.fileinfo.net/extension/utf8[^]
I never came across this file extension before, but it looks like it's ordinary text file in UTF8 encoding - not related to .NET localization features.
As other person said, there are lot of articles about globalization/localization in .NET (I'd post you some links from MSDN but 56k is no-no for MSDN
OT: Firefox suggests "globalization" to be spelled as "cannibalization"
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I start four threads after each other because I want them to run simultaneously, the problem is that they only run one at a time.
The other threads has the state "WaitSleepJoin".
Any idea why this could be?
starting them with the code below, dThreads is an ArrayList:
dThreads.Add(new Thread(new ParameterizedThreadStart(test)));
string s = offset + ";" + (offset + partSize) + ";" + i;
((Thread) dThreads[i]).Start(s);
|
|
|
|
|
Cant tell from the little you told us. Do you care to show more of the code ?
what is i ? are you doing something with priorities ? are there any Thread.Sleep ?
what's inside the test() method: is there any locking involved, explicitly or implicitly ?
etc.
if you want to solve this by yourself: add timestamps to the major actions;
this is the log method I would suggest you use:
public void log(string s) {
int ID=Thread.CurrentThread.ManagedThreadId;
s=DateTime.Now.ToString("mm:ss.fff")+" ["+ID.ToString("X4")+"] "+s;
Console.WriteLine(s);
}
Now insert log statements "everywhere", at least at the start and end of the test method,
and right before your line ... .Start(s); use the string argument to describe what you are
going to do, or just did.
|
|
|
|
|
Thanks for the reply, yes I was vague, sorry.
What I'm doing is downloading a file, in four parts.
These parts should download at the same time.
I have one download-class that I call four times.
So I'm doing four threads that each starts a new thread in the download-class.
There is no sleeping or locking.
private ArrayList downloads;<br />
private void StartDownload()<br />
{<br />
downloads = new ArrayList(1);<br />
dThreads = new ArrayList(1);<br />
webRequest = (HttpWebRequest)WebRequest.Create(downloadUrl);<br />
if (!dowloadProxy.Equals(string.Empty))<br />
webRequest.Proxy = new WebProxy(dowloadProxy);<br />
webRequest.Credentials = CredentialCache.DefaultCredentials;<br />
webResponse = (HttpWebResponse)webRequest.GetResponse();<br />
int fileSize = (int)webResponse.ContentLength;<br />
<br />
int partSize = fileSize / parts;<br />
int lastPart = fileSize - partSize * parts;<br />
<br />
int offset = 0;<br />
for(int i=0; i<parts; i++)<br />
{<br />
dThreads.Add(new Thread(new ParameterizedThreadStart(test)));<br />
string s = offset + ";" + (offset + partSize) + ";" + i;<br />
((Thread) dThreads[i]).Start(s);<br />
<br />
offset += partSize;<br />
<br />
if (i == parts - 2)<br />
partSize += lastPart;<br />
}<br />
}<br />
<br />
private void test(object nums)<br />
{<br />
string[] split = ((string) nums).Split(';');<br />
int start = Int32.Parse(split[0]);<br />
int stop = Int32.Parse(split[1]);<br />
<br />
downloads.Add(new Download());<br />
i = downloads.Count - 1;<br />
<br />
((Download)downloads[i]).StartPoint = start;<br />
((Download)downloads[i]).EndPoint = stop;<br />
<br />
((Download)downloads[i]).InitDownloadFile(downloadUrl);<br />
((Download)downloads[i]).DownloadFile(outFile + "." + i);<br />
}<br />
|
|
|
|