|
#1. maybe, the parameters that you are sending from code are more than the actual parameters of stored procedure.
OR
#2. try to call the stored procedure with fully qualified name. (eg: dbo.myStoredProcedure or mydb.dbo.myStoredProcedure )
OR
#3. check-out this article[^] if you are using Datagrid view or ObjectDataSource
Hope it helps...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
hey guys ! I have like 20 forms in my project that all are pretty much the same, so i'm looking for a way to doublicate them(Like in delphi)! I tried to add Inherite forms but when i do that I just get the controls not the code !!
plz help me out
Thanx
Mr.K
|
|
|
|
|
mrkeivan wrote: I have like 20 forms in my project that all are pretty much the same,
Why not use only 1 form if all forms are the same?
mrkeivan wrote: so i'm looking for a way to doublicate them
What about "Copy and Paste"?
mrkeivan wrote: I tried to add Inherite forms but when i do that I just get the controls not the code !!
Yeah. This is the way it is.. this is like inheriting the base class. When you inherit the base class, the new class won't get the code but it access its parent functionalities.
What about creating a user control?
If the most of things (controls, layout) are the same, you may probably create one user control. Place this control in all forms.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
There is posisbility to use inherited forms. (In the new item window). I tried to use this, but it does not work well with the form designer view (unfortunately). You can try to put all functional stuff in a separate class and use an object of this class in your form. You even can attach alle controls to control functionality you define in this class.
Rudolf Heijink
|
|
|
|
|
Rudolf Jan Heijink wrote: but it does not work well with the form designer view (unfortunately).
ya. me too.. it sucks..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I hava a page,named TaskConf,there is a System.Windows.Forms.Timer timer1,and there is a funtion named SetTmier() to Start timer1
public void SetTimer()
{
timer1.interval = 60000;
timer1.Ticked += new EventHandler(Task_refrush);
timer1.Enable = true;
}
The funtion Task_refrush is the event funtion,which is belong to page TaskConf.
In the other page login I call TaskConf Constructor,and then Start two thread to Start SetTimer and Task_refrush which ara belong to TaskConf:
TaskConf tc = new TaskConf();
.
.
.
..
...
Thread t1 =new Thread(new ThreadStart(tc.Task_refrush));
t1.Start();
Thread t2 = new Thread(new ThreadStart(tc.SetTimer));
t2.Start();
I found these two threads are all running,The code in Task_refrush and SetTimer is excuted,(TaskConf is not open,but constructed,only the page login is open),the timer1 in TaskConf is started,but why the timer1 does not run the funcion Task_refrush every minute?Why?
|
|
|
|
|
supercsharp1 wrote: I hava a page,named TaskConf,there is a System.Windows.Forms.Timer timer1
Are you using Windows.Forms.Timer in ASP.NET Webpage??
If you are calling the start() function of timer in constructor of the form, Tick() event of timer will get fired without showing the form...
public Form3()<br />
{<br />
InitializeComponent(); <br />
timer1.Start();<br />
}
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
how can i encrypt a string into binary and save it into Database as binary???
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Have a look at http://www.codeproject.com/useritems/Encrypt_an_string.asp
|
|
|
|
|
thankx
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
I am opening about 70 web pages and pulling about 1000 strings from each. My arrays tend to be 60,000 to 100,000 string arrays.
The problem I am having is this is very slow. I am using RegEx to get the 1000 names from each web page, and then putting them into a SQL database.
How do I speed this process up, it takes around 20 minutes.
I think one major slow down is I am inserting them into the database one by one. Is there a way to fix this piece? Will stored procedures help?
Is there a faster way to implement a RegEx like solution to speed up the string collection?
Is the fact that I am using an ArrayList the huge slow down?
Any help, suggestions, articles, anything, would be greatly appriciated.
Thanks!
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I have some suggestions for you.
#1. It might be slow down because of Regular expression. Using regular expression is good but it is totally depend on how you write.. I have seen a lot of regular expressions that makes the application slows.. so, my advice is that maybe you can double check the regx that you are using ... but yeah. if you are a master in regx then this is not the fact..
Expert Coming wrote: I think one major slow down is I am inserting them into the database one by one. Is there a way to fix this piece?
#2. You should not open and close the connection each time you are inserting the data. You can open one connection and then, just keep on using the connection that you have opened. after insertion done, you can close this connection..
Expert Coming wrote: Is the fact that I am using an ArrayList the huge slow down?
I think ArrayList should be okay. I'm not sure what else we should use instead of ArrayList. you are using Generic ArrayList.. right??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Expert Coming wrote: I think one major slow down is
There's one saying: To think means to know sh*t There's also one about optimalizations: measure, measure, measure. Get a profiler, or even use the Stopwatch to find out what really slows the code down. It could be regex, it could be database, it could be ArrayList, it could be because it's weekend.
btw, use StringCollection or generic collection (like List<String> etc), because good ol' ArrayList works with objects, so it does all the slow things like casts and boxing.
[ 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
|
|
|
|
|
If things are slow the culprit is either regex or the database access (or both),
certainly not the ArrayList. One more possibility is you are exhausting memory
causing lots of disk accesses (I trust you would notice that).
Now 20 minutes for 100K strings is way too much, so maybe you wasted lots of time
everywhere. It may help to do the following:
- check for linear behavior: does doing half the job (half as many strings) take half
the time ? if not, something is deteriorating, maybe you selected a non-linear
algorithm somewhere, and maybe you created some memory leaks.
- get accurate time measurements on all the steps for one of the strings (but not
the very first one), so add log statements everywhere and look for the biggest
gap in time. A log statement could be:
if (stringCount==100) log("going to create regex");
and then you need to add the method to every class concerned:
public static void log(string s) {
Console.WriteLine(DateTime.Now.ToString("hh:mm:ss.ff")+" "+s);
}
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Expert Coming wrote: I am opening about 70 web pages and pulling about 1000 strings from each. My arrays tend to be 60,000 to 100,000 string arrays.
Do you open all the web pages and pull the strings out before you start processing the data? If so you may wish to start processing before you have got all the data. That way you can clear out some of the data before processing the next batch which keeps memory requirements down which means you don't have to keep requesting more from the OS which can take time.
So, if you can process one page at a time at 1000 strings, rather than all 70 pages at 70,000 strings you might find that your process runs a bit quicker.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Please provide code for convertion of tif image file to binary format using C#
parthiban
|
|
|
|
|
Search google and codeproject. You will find plenty of articles on how to do this.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I have created a windows service application.
Now i need to create a .msi file to be delivered to the client.
|
|
|
|
|
Hi there,
I've got an URGENT need to get hold of a bit of coding to programmatically add directory security, while creating directories through a software which I am working on.
It could be to hide or restrict access. That doesn't matter as long as access is controlled.It's better if a toggle security functionality is also there. But, however, let's focus on getting the security par first.
Got any codings or references (relevant for C#)?
Regards,
A
|
|
|
|
|
|
I'm a novice in c# programing,I wanna to devolop a windows application implement communication between many clients and one server,and I don't know how to do it first.
|
|
|
|
|
liucaihua wrote: a windows application implement communication between many clients and one server,
That's a pretty vague description. See this[^] for several examples. I highly recommend using WCF[^].
/ravi
|
|
|
|
|
hi
i want using thread in my app to show Waiting form, then my app load it's data,i close Waiting form by threadObj.Abort() method, in my computer, app work correctly, but when i copy my app on another machine and run it, the ThreadAbortException has occured (sometimes occured and sometimes not occured), i was used try-catch block to catch this exception but was not successful, here is my code :
private void Frm_Land_Load(object sender, EventArgs e)<br />
{<br />
System.Threading.Thread th = new System.Threading.Thread(gu.Show_WaitingForm);<br />
th.Start("Loading Data ...");<br />
Application.DoEvents();<br />
<br />
this.Initialize_Data();<br />
this.txt_date.Text = this.sh.Show_Hijri_System();<br />
this.toolStripStatusLabel1.Text = "Ready";<br />
<br />
Application.DoEvents();<br />
th.Abort();
how to solve my problem ?
|
|
|
|
|
hdv212 wrote: how to solve my problem ?
Don't use the Abort method.
You could use the BackgroundWorker[^] class instead for loading your app's data. It can report the progress to your user as it loads data, you can use a progress bar on a dialog box or just display the results in tool strip.
|
|
|
|
|
Why would you want to abort the thread? Why not make it exit normally using some event signalling mechanism?
That apart, what exactly does the thread do? If all it does is show a form, you're much better off doing it in the UI thread (the thread that Frm_Land_Load runs on) and doing this.Initialize_Data on a different thread. Something like
private void Frm_Land_Load(object sender, EventArgs e)
{
Thread th = new Thread(DoWork);
th.Start();
gu.Show_WaitingForm();
}
private void DoWork()
{
this.Initialize_Data();
this.BeginInvoke(new MethodInvoker(CloseWaitingForm), null);
}
private void CloseWaitingForm()
{
gu.Hide_WaitingForm();
}
This way, when Initialize_Data completes, CloseWaitingForm will be called on the main UI thread, which will hide the waiting form.
This solution assumes that Initialize_Data does not access any controls in the form. If it does, then you'll have to run the waiting form on a different thread. Something like
private void Frm_Land_Load(object sender, EventArgs e)
{
Thread th = new Thread(gu.Show_WaitingForm);
th.Start();
this.Initialize_Data();
gu.Hide_WaitingForm();
}
class GU
{
Form f;
void Show_WaitingForm()
{
f = new Form();
f.ShowDialog();
}
void Hide_WaitingForm()
{
if (this.InvokeRequired)
{
f.BeginInvoke(new MethodInvoker(Hide_WaitingForm), null);
}
else
{
f.Close();
}
}
}
Hope this helps.
|
|
|
|