|
thanks we have decided to use webclient method which is by default available in c#.
Pushpa Sengathiron
|
|
|
|
|
Hi All,
I'm having trouble putting my question into words, so if it sounds funny, i'm sorry. But here goes...
I've created a View in SQL that contains all the info i need from the different tables i have. The view contains Example:
TransactionDate, StaffID, StaffName, BrandID, BrandName, TotalCash, TotalQty
2006/03/01, 1, Jan, 2, Loreal, 250, 10
2006/03/01, 1, Jan, 3, Kerastase, 200, 8
2006/03/01, 2, Koos, 1, Revlon, 200, 11
2006/03/01, 2, Koos, 2, Loreal, 290, 12
2006/03/02, 1, Jan, 1, Revlon, 500, 25
2006/03/02, 1, Jan, 3, Kerastase, 345, 15
2006/03/03, 1, Jan, 3, Kerastase, 100, 6
2006/03/04, 2, Koos, 1, Revlon, 120, 3
With this examle jou see that i've calculated the totals on the TransactionDate for each Staffmember for each Brand.
I want to know if it is possible to write a procedure in SQL and send from C# a DateValue and BrandID to SQL to let the procedure know that it should only do the calculation between a specified Date and on every Brand. I need One total for each brand between the specified date: example 2006/03/01 - 2006/03/03.
I can do the calculation in C# but i need to speed up the processing time by using the database to do the calculation and not the application we wrote. Would Using a procedure in SQL actually speed up the Process or Would our application still run more or less the same time because it has to send a value to the database and wait for the calculation to complete and get the Value back from the Database?
I need to know rather urgantly Please. Thank you in advance.
|
|
|
|
|
Hi
You can do it by passing two parameters(both dates start and end date) to the procedure and in procedure use group by brand clause . I think yours problem will be solved.
|
|
|
|
|
Thanks, but would this method actually speed up things?
|
|
|
|
|
Generally, yes.
There already is functionality to do grouping in the database, but if you do the work in C# you would have to build it more or less from scratch. Less code is less risk for bugs, and also testing a query is easier than testing a lot of C# code.
If you run into performance problems you might want to try to do the grouping on the original data instead of the view, and add indices on the fields you are grouping on and comparing.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I used a number of Textboxes in Web Application using C#, now i want to access all these but i don't want to write name of each textbox i just want to use an ARRAY to assign values (Or Access these textboxes), I saw this somewhere in Visual Basic 6.0 but i don't know how can i do that in Visual Studio 2003 please tell me some solution for this to avoid write the names of all these ???????????????
Waiting to hear something soon from anyone
Regards,
AbuBakar
|
|
|
|
|
First: Please don't write your postings two, three or four times!
Your form has got the Controls property. You can access all controls using it. Check if the control is a textbox then you can work with it.
for (int i = 0; i < this.Controls.Count; i++) {
if (String.Compare(this.Controls[i].GetType().ToString(), "System.Windows.Forms.TextBox") == 0) {
((System.Windows.Forms.TextBox)this.Controls[i]).Text = "Bla";
} // if
} // for i
Greetings,
Ingo
------------------------------
PROST Roleplaying Game
|
|
|
|
|
First: My Internet speed was very slow that's y i sent problem more than one time.
Hello,
Thanks a lot for every brother, dear i want to do this in Web Application <asp:textbox> not in Windows Application so please send me some code how can i add textboxes in controls and use later on..
Regards,
AbuBakar
|
|
|
|
|
I don't think the control array is in .NET any more (and good riddance!!).
If you use WinApp, you can dynamically create the controls and assign the names to the controls (textBox001, textBox002 etc). Then you can put the controls in a collection such as hashtable for easy access. Though I am not sure how is it to be done in web app.
I would suggest you use dynamic array sparringly, only if you need to, but because of lazy to type out the names. The last vb program that I need to do some enhancement, I was cursing and swearing when I trying to debug the forms. Can you imagine that the whole application consist only of control array of buttons, textboxes, checkboxes?!!
|
|
|
|
|
Hi
You can get TextBoxArray controller using “Microsoft.VisualBasic.Compatibility.VB6” Namespace.
I did not try. Please try with this.
Good luck
Chandana
|
|
|
|
|
Hello,
I used a number of Textboxes in Web Application using C#, now i want to access all these but i don't want to write name of each textbox i just want to use an ARRAY to assign values (Or Access these textboxes), I saw this somewhere in Visual Basic 6.0 but i don't know how can i do that in Visual Studio 2003 please tell me some solution for this to avoid write the names of all these ???????????????
Waiting to hear something soon from anyone
Regards,
AbuBakar
|
|
|
|
|
Hello,
I used a number of Textboxes in Web Application using C#, now i want to access all these but i don't want to write name of each textbox i just want to use an ARRAY to assign values (Or Access these textboxes), I saw somewhere in Visual Basic 6.0 but i don't know how can i do that in Visual Studio 2003 please tell me some solution for this to avoid write the names of all these ???????????????
Waiting to hear something soon from anyone
Regards,
AbuBakar
|
|
|
|
|
I would like to catch the sql error that returns from the stored procedure.
The SP is written in 2005 with try/catch statement.
What should be placed in the catch statement of the SP and how can the .net code i.e vb.net or C# get this error to show to the user?
Thanks
|
|
|
|
|
try
{
//ur code
}
catch(SqlException ee)
{
Response.Write("alert('" + ee.Message+ "')");
}
|
|
|
|
|
It depends on the client application (ASP.NET, Console, or WinForm).
In all cases, I would build a string that explains the exception, including any property particular to the SqlException class.
When the string is ready, there are many ways to display it to the user:
ASP.NET: You may use a label.
WinForm: MessageBox
Console: Console.Error.WriteLine
Some piece of advice:
- When displaying error information, give the user the tools to fix the problem, by telling as much as possible to the user. In the case of the SqlException class, there are the Procedure, LineNumber, Number, etc. properties. There is nothing more frustrating than the "An error occured" message.
- In the Console version, notice the use of the Error StreamWriter property of the class. I do this, because the Console.WriteLine call outputs to the regular output stream.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hello!
Remember, in setup of account record Outlook there is an opportunity to open postbox of other user.
How to retrieve contacts list other Outlook user postbox?
I shall be grateful for any information on the given question.
Thanks,
Alexander
|
|
|
|
|
How can i draw a line or rectange in a ASP.net Web form by getting the points from the user or by using mouse down event.
Rohit
|
|
|
|
|
The mouse events are obviously client side, so you would do it using Javascript or something. As it is client side, there is nothing specific .NET related to this. And no, I can't point you to any information about how it is done - I have seen someone doing similar things, but I avoid Javascript whenever posibile so I have no intention finding out how it is done.
Alternatively embed a WinForm control on the page. This is probably easier to program but it will only work if the client has the .NET Framework installed.
|
|
|
|
|
thanks a lot for ur reply. Can u just tell me any of the sites where i can get a smple javascript code for that
Rohit
|
|
|
|
|
As I said, I do not touch Javascript so I have no idea where to find samples. Life is too short for weakly types scripting languages.
|
|
|
|
|
|
rTB2.Clear();
int i = 0;
string s = rTB1.Text;
string substr = "";
switch(rTB1.Text)
{
case '"':
{
while (i < s.Length && s[i]!='"' && s[i]!='\n')
{
substr += s[i];
i++;
}
rTB2.Text += "String - " + substr + "\n";
substr = "";
}break;
}
|
|
|
|
|
This is my code. If you see s = rTB1.Text. So you simply rewrite my code. If you can, please help
|
|
|
|
|
a very simple method is to get the first index of " (opening quotes)
and then get the next index of the " (closing quotes)
and the get the substring within those indices
Regards,
Pramod
|
|
|
|
|
I guess You are right, but I mess up something so i could not use that way of solving the problem. If you could give me an example, will be appreciated.
Regards,
Mitko
-- modified at 5:29 Tuesday 7th March, 2006
|
|
|
|
|