|
Is there not such a control you can host in your app? I know Active Reports did ten years ago, so I expect Crystal does by now.
|
|
|
|
|
Hello
I have question:
- how I can change location my task bar from C# code ?
Default location is in bottom, I need in C# - change position my task bar: left, right, top, bottom.
How I can start ? 
|
|
|
|
|
mt1024 wrote: How I can start
I'd start with a Google [^]search, then I'd read some of the responses and see if they give me any ideas for further research.
After that I would refine my searches, read the articles and create a project based on the samples and replies. If I had a specific problem I would either ask on the forum where the article/reply was posted or ask here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The 'normal' ways of doing this no longer work since Vista - let's face it, it's not great for a user if a program moves their taskbar!
The only way I know of to do this now is to simulate clicking, dragging and releasing the mouse at the right coordinates.
|
|
|
|
|
For a C# 2008 desktop/console application I want to share a linq to sql (*.dbml file) between 2 different project files in the same solution.
I know that I should probably put the linq to sql (*.dbml file) in its own project file with a class libary?
Since I do not know how to accomplish this goal, I am wondering if you can point me to a reference on how to accomplish this goal?
|
|
|
|
|
|
Your link is good! However, I would like to use linq to sql (*.dbml) files since that is the way I have the code setup currently.
I have told my boss that (linq to sql) or linq to the entity framework is the better way to go since that is the newest technology. (My boss has some java experince.)
Thus can I setup the class library that connects to the database by using linq to sql and/or linq to some other technology? If so, can you tell me and/or point me to a reference that will accomplish this goal?
|
|
|
|
|
If your talking about non .NET technologies, no. But if you want to create a suit of applications based on .NET, then the n-tier dsign is the way to go. Build a data access library (DAL). Create a business layer (BAL) that references the data access library. Then create seperate applications that reference the business library.
You may be able to take your existing code and refactory it out into the different layers and then start building the new applications and share all that common DAL and BAL code. If your forms/pages are making calls directly to the database in your corrent solution: it may be harder.
"You get that on the big jobs."
|
|
|
|
|
Have to insert a large number of columns into a datatable (178 to be precise). Tried DataTable.Add() but its just too slow. Tried DataColumnCollection.AddRange(dataColumn[]) after creating the array of DataColumns - probably Slower!
It seems to check for column existence etc and other voodoo before adding a column. Is there a way of modifying this behavior?
Thanks in advance.
bart
|
|
|
|
|
This begs some questions!
Why are you using a datatable originating in C#?
If you need a datatable why does it not exist in a database?
Is creating the datatable in the database quicker than in C#?
Why can't you use a collection instead of a datatable?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for your reply. This project doesnt involve/require databases of which i am very very familiar with in many languages. It involves Datasets only! At some point i really considered shipping SQLServer just to cut down the time it takes to insert, delete and sort the datatables.
BTW, do you have any ideas on how to fix this?
{like turn of error checking, insert columns then turn it back on}
bart
|
|
|
|
|
Why not use collections, as you have found out datsets have some serious overheads. While I have built up datatable in code before I have never had to deal with that number of columns and that was when I was using winforms.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Bart wrote: Is there a way of modifying this behavior?
Yes[^], but you'd be wanting to use collections as suggested. 178 columns in a datatable indicates a non-normalized table. Either you have a collection that's going to be dumped, or you need a database.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Working with text files (csv).
Let me have a good look at the collections.
The turn off feature is for loading data...
brb
bart
|
|
|
|
|
Non-normalized data. Wouldn't it be a bit more efficient to load it into a Sqlite database and process it further from there? What are you planning to do with the data?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
A lot of in-memory manipulation (which is all OK) then output to a text file of sorts (no problems with that either).
Trying a different approach before I go to collections. Will create a new datatable(dt) with required cols and then blast data into it. Will probably be 100 times faster.
Report back in a few mins. Dont give up on me yet.....
bart
|
|
|
|
|
I don't manipulate large datasets in memory; seems that most harddisks come with a large cache, and that memory is a limited resource.
FWIW; a List (with the capacity preset) with structs would probably be the fastest "structure". OTOH, if you're manipulating line by line, you'd prolly want a stream, not an in-memory list.
How does your output look like? Another CSV based on the original? What kind of operations are you performing on the dataset?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Have replied to myself as a summary and as a help for others who search in future.
Thanks for your suggestions and will look at collections again soon.
bart
|
|
|
|
|
OK. It works now.
Adding a large number of columns to a datatable is too slow. I created a new table and added the columns I needed on table creation then used addrange.
About 1000 times faster (even though I had to copy all data rows - 156,000).
Now doing same for sorting and deletions.
Thanks all. Project now complete.
New post coming up.
bart
|
|
|
|
|
Nice, that's an increase to be happy with
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
There is a site, username and password. Now I do login in a common way - manually, and then check some info in my profile.
Is it possible to automatize this process? I mean, to call a function from the server that logins with this information + gets some data from cookies?
Can it be done with C# or maybe there are some extentions for this purpose?
|
|
|
|
|
Sorry mate we all have to write a login at some point, MS has various templates and samples that help and standardise the login functionality but there are just too many different environments and requirements to automate it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am trying to create a simple form that uses radio buttons. I set the radio button to AutoPostBack = True, this way if the radio button is true/false, a subpanel is Shown or Hidden. The radio buttons are required fields. I also have a hidden textbox that the value of the selected radio button is inserted and this textbox is what I validate against (empty or not).
Problem 1:
This works until you go to submit and the validation fails. The validation messages show, then when you click on one of the radio buttons with AutoPostBack = True, all the validation disappear. I can resolve this by adding Page.Validate() to the method that runs when the radio button is clicked. But, I do not want the Page.Validate() to run unless the page was already showing validation errors (so it will not re-validate unless the form was already submitted and failed the validation).
As it stands, before the form is submitted and fails validation: when you click on any radio button question, all the other questions requiring validation show the validation error. I am only looking to overcome the AutoPostBack which is clearing all the validation messages that are shown when you had click submit.
Problem 2:
I would like to be able to change the color of the question if it does not pass validation. I added the javascript to override the default .net settings. I got this to work, but only when you click the submit button and not after a RadioButton AutoPostBack.
Currently, When you click submit all the required questions turn red and also display the required validation message. But if you click a radio button to start fixing the validation errors, on the AutoPostBack, the all the questions that were now red in color changes back to the orignal black and the required validation message is still shown. How can I call the Javascript to run again along with the Page.Validation() in the code behind method?
Any help would be greatly appricated! Thanks
Below is an example of the code so far.
ASPX Code:
<asp:Table ID="Table1" runat="server" CellSpacing="0" CellPadding="0">
<asp:TableRow>
<asp:TableCell CssClass="question">
<label>4. Have you had an abnormal result from a prenatal test (e.g. amniocentesis, blood test, ultrasound)?</label>
</asp:TableCell>
<asp:TableCell CssClass="answer">
<ul class="selectGroup">
<li>
<asp:RadioButton ID="Q4_true" runat="server" Checked='<%# Bind("Q4_yes") %>' Text="Yes"
GroupName="4" OnCheckedChanged='RB_QuestionSubPane_YN' AutoPostBack="true" /></li>
<li>
<asp:RadioButton ID="Q4_false" runat="server" Checked='<%# Bind("Q4_no") %>' Text="No"
GroupName="4" OnCheckedChanged='RB_QuestionSubPane_YN' AutoPostBack="true" />
</li>
<asp:TextBox ID="Q4_validationBox" runat="server" CssClass="hiddenField" Enabled="false"
Text=''></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" EnableViewState="true" ControlToValidate="Q4_validationBox"
Display="Dynamic" runat="server" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
</ul>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
Code Behind
protected void RB_QuestionSubPane_YN(object sender, EventArgs e)
{
RadioButton radio_Selected = (RadioButton)sender;
string radio_QuestionID = Convert.ToString(radio_Selected.ID);
(((TextBox)FormView1.FindControl(strQuestionID + "_validationBox")).Text) = radio_Selected.ID.ToString();
Page.Validate();
}
JavaScript
ValidatorUpdateDisplay = function (val) {
var ctl = $('#' + val.controltovalidate);
var eCount = 0;
for (var i = 0; i < Page_Validators.length; i++) {
var v = Page_Validators[i];
if (v.controltovalidate == val.controltovalidate) {
if (!v.isvalid) {
eCount++;
ctl.addClass('validationError');
$('td.question:eq(' + i + ')').addClass('red');
}
};
}
if (eCount > 0) {
ctl.addClass('validationError');
} else {
ctl.removeClass('validationError');
$('td.question:eq(' + i + ')').removeClass('red');
}
if (typeof (val.display) == "string") {
if (val.display == "None") {
return;
}
if (val.display == "Dynamic") {
val.style.display = val.isvalid ? "none" : "inline";
return;
}
}
if ((navigator.userAgent.indexOf("Mac") > -1) &&
(navigator.userAgent.indexOf("MSIE") > -1)) {
val.style.display = "inline";
}
val.style.visibility = val.isvalid ? "hidden" : "visible";
}
|
|
|
|
|
hi guys , im facing a delay problem , i have made a program with c#.net it has couple forms the forms has couple button and couple datagridview and some other controls and every button do the right thing. like adding ,updating and deleting from database and so one , (automation program) . one of my page was working good but after some time its now very slow in working , and only this page is very slow in respond , like (typing in textbox ) is very slow .but not other pages .
im using the Devcomponent in all of my forms , and using some dll's two , and using access database , and even when i extract a setup of the program or made a setup , nothing changed even it get worse on other computers too.
any help . i'll appreciate that .
maybe the problem is my database or the dev components or maybe it bcz of the size of the control that window has carry on , bcz im using a super tab control with 4 tab on it two tab of this 4 tab have alot of control textboxX and comboboxX maybe it bcz of that reason that make the form work very slow . or maybe sth else.
modified 9-Sep-12 11:30am.
|
|
|
|
|
The problem could be anywhere. Try a profiler to identify your bottlenecks, it'll highlight the methods that take the most time to execute.
DevExpress does require additional resources, one of my arguments to not use them. I assume you are using their BeginUpdate methods? Still, that's hardly enough to bring a modern PC to a grinding halt. How about you posting one of the offending queries?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|