Click here to Skip to main content
15,900,645 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Error inserting records into MySql table using Asp 2.0 Pin
doWhileSomething19-May-08 15:10
doWhileSomething19-May-08 15:10 
QuestionFormat the value in report Pin
member2719-May-08 1:44
member2719-May-08 1:44 
QuestionI need ur views to make improvements in the DataBase Interaction file. Pin
Pankaj Garg19-May-08 0:38
Pankaj Garg19-May-08 0:38 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Vasudevan Deepak Kumar19-May-08 0:51
Vasudevan Deepak Kumar19-May-08 0:51 
GeneralRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Pankaj Garg19-May-08 0:55
Pankaj Garg19-May-08 0:55 
GeneralRe: I need ur views to make improvements in the DataBase Interaction file. Pin
Vasudevan Deepak Kumar19-May-08 18:49
Vasudevan Deepak Kumar19-May-08 18:49 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. Pin
N a v a n e e t h19-May-08 1:20
N a v a n e e t h19-May-08 1:20 
AnswerRe: I need ur views to make improvements in the DataBase Interaction file. [modified] Pin
J4amieC19-May-08 1:40
J4amieC19-May-08 1:40 
Pankaj Garg wrote:
According to me this is my Best code ever written in my carrier.


Change career! Its some of the worst data abstraction code Ive seen in my career!

eg/ what the hell is all this about (note: p is set to an array with 1 element):

Pankaj Garg wrote:
public void ParameterFunction<T>(string ParameterName, T _ParameterValue, ParameterDirection ParameterDirection, SqlDbType ParameterType)
{
if (p[p.Length - 1] != null)
{
AddParameters[] temp = new AddParameters[p.Length];
p.CopyTo(temp, 0);
p = new AddParameters[p.Length + 1];
for (int i = 0; i < p.Length - 1; i++)
{
p[i] = temp[i];
}
p[p.Length - 1] = new AddParameters();
p[p.Length - 1].param.ParameterName = ParameterName;
p[p.Length - 1].param.Value = _ParameterValue;
p[p.Length - 1].param.Direction = ParameterDirection;
p[p.Length - 1].param.SqlDbType = ParameterType;
}
else
{
p[0] = new AddParameters();
p[0].param.ParameterName = ParameterName;
p[0].param.SqlValue = _ParameterValue;
p[0].param.Direction = ParameterDirection;
p[0].param.SqlDbType = ParameterType;
}
}
}


and this is just car-crash stuff. I shouldnt look, but at the same time I cant look away OMG | :OMG:

public string GetDataSet(SqlConnection con, ref DataSet ds)
{
    try
    {

        cmd = new SqlCommand();
        cmd.Connection = con;
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = StoredProcedure;
        if (ad != null)
        {
            if (ad.p[0] != null)
            {
                if (ad.p.Length != 0)
                    ReturnSqlCommand(ref cmd, ad.p);
            }
        }
        ds = new DataSet();

        sqlad = new SqlDataAdapter(cmd);
        sqlad.Fill(ds);
        if (ad.p[0] == null)
        {
            return "";
        }
        for (int count = 0; count < ad.p.Length; count++)
        {
            if (ad.p[count] == null)
                continue;
            if (ad.p[count].param.Direction == ParameterDirection.Output)
            {
                ad.p[count].param.SqlValue = cmd.Parameters[count].Value.ToString();
            }
            if (ad.p[count].param.Direction == ParameterDirection.InputOutput)
            {
                ad.p[count].param.SqlValue = cmd.Parameters[count].Value.ToString();
            }
        }
        return "";
    }
    catch (Exception ex)
    {
        return ex.Message.ToString();
    }
}


Tell me, how do you call a stored procedure with more than 1 parameter?

modified on Monday, May 19, 2008 8:31 AM

QuestionCompiler Error Message: CS0246: The type or namespace name 'XYZ' could not be found ...... Pin
Aldorado19-May-08 0:20
Aldorado19-May-08 0:20 
QuestionHow to use button control inside ModalPopup Ajax Control Pin
girishdonde18-May-08 23:59
girishdonde18-May-08 23:59 
AnswerRe: How to use button control inside ModalPopup Ajax Control [modified] Pin
Vinay Dornala19-May-08 1:39
Vinay Dornala19-May-08 1:39 
QuestionHow i can resolve this error? Pin
Saba0218-May-08 23:35
Saba0218-May-08 23:35 
AnswerRe: How i can resolve this error? Pin
Saba0218-May-08 23:45
Saba0218-May-08 23:45 
GeneralRe: How i can resolve this error? Pin
Vasudevan Deepak Kumar19-May-08 0:16
Vasudevan Deepak Kumar19-May-08 0:16 
AnswerRe: How i can resolve this error? Pin
Aldorado19-May-08 0:24
Aldorado19-May-08 0:24 
AnswerRe: How i can resolve this error? Pin
Pankaj Garg19-May-08 1:02
Pankaj Garg19-May-08 1:02 
QuestionHow i can resolve this error? Pin
Saba0218-May-08 23:30
Saba0218-May-08 23:30 
AnswerRe: How i can resolve this error? Pin
eyeseetee18-May-08 23:35
eyeseetee18-May-08 23:35 
AnswerRe: How i can resolve this error? Pin
Vasudevan Deepak Kumar19-May-08 0:46
Vasudevan Deepak Kumar19-May-08 0:46 
AnswerRe: How i can resolve this error? Pin
N a v a n e e t h19-May-08 1:26
N a v a n e e t h19-May-08 1:26 
GeneralRe: How i can resolve this error? Pin
Saba0219-May-08 2:16
Saba0219-May-08 2:16 
QuestionA very simple query.. but i can`t get it done Pin
NetBot18-May-08 21:35
NetBot18-May-08 21:35 
AnswerRe: A very simple query.. but i can`t get it done Pin
Blue_Boy18-May-08 21:42
Blue_Boy18-May-08 21:42 
AnswerRe: A very simple query.. but i can`t get it done Pin
eyeseetee18-May-08 21:44
eyeseetee18-May-08 21:44 
AnswerRe: A very simple query.. but i can`t get it done Pin
J a a n s18-May-08 22:58
professionalJ a a n s18-May-08 22:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.