|
Yes, that was how I was doing it. The original was a virtual method, but I expected him to override automatically. Though, it does make more sense this way, and offers more possibilities.
Thank you, once again, for the explanation.
Gonçalo A.
|
|
|
|
|
Hi,
you should pay attention to the messages the compiler emits. If you try and redefine a
virtual method without either "new" or "override", a warning is issued.
Don't lower the warning level (a project setting, 4 is a good value) to get rid of
(some of) the messages, study the messages and adapt your code instead.
|
|
|
|
|
Yes, I noticed that already.
Thanks.
Gonçalo A.
|
|
|
|
|
hi,
In my webapplication in some pages they following error is showing but i don't know how to solve this problem.please solve my problem.error is like this.
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find server 'WINHOSTING02' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
/backoffice/entrysubmit.asp, line 76
please help me .
obalesu
|
|
|
|
|
obalesu wrote: please solve my problem.
No.
And why are you using ODBC to access SQL Server in the first place?
|
|
|
|
|
hi all,
how can we show a progress bar to the user while loading data in dataset from sql server database.please help me .
Thanks For Any Body Hellp me
|
|
|
|
|
I tried to do a similar thing a long time ago, at that time I was thinking abt getting some sort of progress from SQL server but in theend I came to know that it wasnt possible. probably u can show some other graphic while the data is being loaded and hide that when ur done.
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Rocky is probably right - unless you've got a known, fixed start and end point and status updates along the way (which you don't have with SQL loads), a progress bar is probably not the right UI choice.
Something that indicates a long-running process is probably better - a loading circle or an animated gif. There are some great loading circles here on Code Project.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hi All,
I am have created some custom controls so i have a dll.
Now i want create my own toolbox and wana add these controls to this toolbox.
But i don't know yet how to create a toolbox.
if anyone knows pls tell me.
Praveen Sharma
|
|
|
|
|
right click on toolbar>Choose Items>> Select ur DLL and ok
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Hi all,
How can we show a progress bar while loading data into datagrid from database(sql server).
please help me.
thanks in advance
|
|
|
|
|
hi all,
I Have created one Windows application with c# and sqlserver.after completion setup file.in solution explorer window the detected dependencies are:
ms.net framework,
dao360.dll,
excel.exe,
interop.access.dll,
interop.dao.dll,
interop.excel.dll,
interop.microsoft.office.core.dll,
interop.owc10.dll,
interop.vbide.dll,
msacc.olb,
mscomctl.dll,
mso.dll,
owc10.dll,
vbe6ext.olb
please help me inthis problem how can i deploy this windows application.
thanks in advance.
|
|
|
|
|
|
thank you sending reply.
how can i add these dependencies to set up project.
|
|
|
|
|
As a beginner about making WebService routines and caller applications, I prepared WebService Application that have a few functions in Visiual Studio using C#, .Net 2.0. And I have written a client application running under WindowsCe that calls those WebSevice functions located in a Server environemnt.
The system works well except for first calls. I mean: When the client calls a WebService function for the FIRST time, it takes considerable time ( at least 8-10 seconds) the functions executes and return back. Immediately after the first call, the next calls (to same function) works in good speed.
So Why first calls always takes time..?
Note: In Web service side, I did not use any attribute for functions. Should I use?
|
|
|
|
|
I've struggled with this too. i found it was because internet explorer was set to automatically detect proxy settings.
so. if it's set your program will try to find a proxy server and wait for timeout.
add a proxy object:
<br />
System.Net.WebProxy objProxy = new System.Net.WebProxy("http://1.2.3.5:8080/", true);<br />
YourService.Proxy = objProxy;<br />
or if you dont have a proxy
<br />
YourService.Proxy = null; <br />
it might work.
If it' stuck, DO NOT pull harder!
|
|
|
|
|
Hi all,
Can anybody help me here ... how to run a procedure with outparameter...
please provide the code if u can... Thanks alot
T@SU
|
|
|
|
|
using (SqlConnection sc = new SqlConnection())
{
StringBuilder sql = new StringBuilder();
sql.Append("exec sp_YourProc");
string connStr = "...";
sc.ConnectionString = connStr;
sc.Open();
using (SqlCommand sco = new SqlCommand())
{
try
{
sco.CommandType = CommandType.Text;
sco.CommandText = sql.ToString();
sco.Connection = sc;
using (SqlDataReader sr = sco.ExecuteReader())
{
}
}
catch (SqlException exc)
{
}
}
SkyWalker
|
|
|
|
|
Where's the output param the OP asked about?
|
|
|
|
|
use sco.Parameters.Add()
SkyWalker
|
|
|
|
|
Same as any normal procedure, just make sure you add the output parameter and give it a Direction of Output (or InputOutput)
SqlParameter outParam = new SqlParameter("@myOutParam",SqlDbType.Int);<br />
outParam.Direction = ParameterDirection.Output;<br />
myCmd.Parameters.Add(outParam);
|
|
|
|
|
Thanks alot for ur replies....
after executing the procedure ...
how to retrive the result.. am trying like this but it dosent work..
dataset abc=cmd.ExecuteNonQuery();
i have done like this.....
SqlConnection conn = new SqlConnection(connc);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_abc";
SqlParameter paramPAF = new SqlParameter();
paramPAF.ParameterName = "P_Id";
paramPAF.SqlDbType = SqlDbType.Int;
paramPAF.Value = Section_Id;
paramPAF.Direction = ParameterDirection.Input;
SqlParameter paramNbr = new SqlParameter();
paramNbr.ParameterName = "ResultRS";
paramNbr.SqlDbType = SqlDbType.Variant;
paramNbr.Direction = ParameterDirection.Output;
cmd.Parameters.Add(P_Id); // parameter 1
cmd.Parameters.Add(sp_abc);
cmd.ExecuteNonQuery();
so now how to use third parameter "ResultRS" ?
Please help me here..
vikas da
|
|
|
|
|
You have to use the cmd.ExecuteReader() and not the cmd.ExecuteNonQuery() - the last method return an int of numbers of rows affected, usually used with insert query or update query (also useful with select count...).
Try this:
SqlDataReader reader = cmd.ExecuteReader();
reader.Close();
string result = reader["ResultRS"].ToString();
|
|
|
|
|
it is showinf error like "Procedure or function has too many arguments specified".
i am using "paramNbr.SqlDbType = SqlDbType.Variant;" in case out parameter sqldbtype is that fine..
T@SU
|
|
|
|
|
SqlConnection conn = new SqlConnection("CONNECTION HERE");
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_abc";
//Create the first parameter
SqlParameter firstParam = new SqlParameter("P_Id", SqlDbType.Int);
firstParam.Value = 0; //Place your variable
firstParam.Direction = ParameterDirection.Input;
cmd.Parameters.Add(firstParam); //Parameter 1
//Create the second parameter
SqlParameter secondParam = new SqlParameter("ResultRS", SqlDbType.Variant);
secondParam.Direction = ParameterDirection.Output;
cmd.Parameters.Add(secondParam); //Parameter 2
int count = cmd.ExecuteNonQuery();
Console.WriteLine(secondParam.Value.ToString());
This is correct now, secondParam.Value and you read the value
News at http://support.microsoft.com/kb/308621[^]
modified on Monday, January 07, 2008 8:36:36 AM
|
|
|
|