Click here to Skip to main content
15,914,322 members
Home / Discussions / C#
   

C#

 
QuestionHow i can block the incomming network traffic using C# .NET Pin
Tahir Abbasi22-Apr-08 8:16
Tahir Abbasi22-Apr-08 8:16 
AnswerRepost ignore Pin
led mike22-Apr-08 8:39
led mike22-Apr-08 8:39 
AnswerRe: How i can block the incomming network traffic using C# .NET Pin
Pete O'Hanlon22-Apr-08 8:49
mvePete O'Hanlon22-Apr-08 8:49 
GeneralRe: How i can block the incomming network traffic using C# .NET Pin
Paul Conrad22-Apr-08 15:28
professionalPaul Conrad22-Apr-08 15:28 
Generalproblems splitting string Pin
stephan_00722-Apr-08 7:55
stephan_00722-Apr-08 7:55 
GeneralRe: problems splitting string Pin
led mike22-Apr-08 8:40
led mike22-Apr-08 8:40 
GeneralRe: problems splitting string Pin
Guffa22-Apr-08 8:46
Guffa22-Apr-08 8:46 
GeneralRe: problems splitting string Pin
stephan_00722-Apr-08 9:56
stephan_00722-Apr-08 9:56 
GeneralRe: problems splitting string Pin
Guffa22-Apr-08 13:27
Guffa22-Apr-08 13:27 
GeneralRe: problems splitting string Pin
WBurgMo22-Apr-08 9:51
WBurgMo22-Apr-08 9:51 
GeneralRe: problems splitting string Pin
stephan_00722-Apr-08 10:48
stephan_00722-Apr-08 10:48 
GeneralWord plugin - working button Pin
Vodstok22-Apr-08 5:45
Vodstok22-Apr-08 5:45 
GeneralRe: Word plugin - working button Pin
Spacix One22-Apr-08 9:51
Spacix One22-Apr-08 9:51 
General"Remember my password" in a winforms application Pin
benjymous22-Apr-08 5:16
benjymous22-Apr-08 5:16 
GeneralRe: "Remember my password" in a winforms application Pin
led mike22-Apr-08 8:51
led mike22-Apr-08 8:51 
GeneralRe: "Remember my password" in a winforms application Pin
User 665822-Apr-08 8:59
User 665822-Apr-08 8:59 
General[Message Deleted] Pin
gottimukkala22-Apr-08 4:42
gottimukkala22-Apr-08 4:42 
GeneralRe: Wrong board Pin
Blue_Boy22-Apr-08 4:44
Blue_Boy22-Apr-08 4:44 
GeneralSqlParameter problem Pin
Deian22-Apr-08 3:53
Deian22-Apr-08 3:53 
Hello,

I have the following function, which is returning dataset from any of the desired identical databases. For some reason, I get exception "Must declare parameter @id"

public DataSet GetCustomerDevices(int nCustomerID, int nDatabaseID)<br />
        {<br />
            svcMSSQL mssql = new svcMSSQL();<br />
            DataSet dsDevices = new DataSet();<br />
<br />
            try<br />
            {<br />
                SqlConnection sqlConn = (SqlConnection)mssql.CreateConnection(clsConnStr.GetConnectionString());<br />
                <br />
                // get database details<br />
                string strDatabase = GetDatabaseName(nDatabaseID);<br />
<br />
                SqlCommand sqlCmd = (SqlCommand)mssql.CreateCommand("SELECT ColNo1, ColNo2, ColNo3 FROM "+strDatabase+".dbo.tblClientProc WHERE PartnerCode=@id ORDER BY ColNo1 ASC", sqlConn);<br />
                sqlCmd.Parameters.AddWithValue("@id", nCustomerID.ToString());<br />
                sqlCmd.Parameters["@id"].SqlDbType = SqlDbType.Int;<br />
<br />
                foreach (SqlParameter param in sqlCmd.Parameters)<br />
                {<br />
                    clsDebug.WriteString("Param name: " + param.ParameterName + ", Param Type: " +param.SqlDbType.ToString()+ ", value is: " + param.Value);<br />
                }<br />
<br />
                SqlDataAdapter sqlAdapter = (SqlDataAdapter)mssql.CreateDataAdapter(sqlCmd, sqlConn);<br />
                sqlAdapter.Fill(dsDevices);<br />
<br />
                sqlCmd.Dispose();<br />
                sqlAdapter.Dispose();<br />
                sqlConn.Dispose();<br />
            }<br />
            catch (Exception e)<br />
            {<br />
                clsDebug.ReportError(e.Message);<br />
            }<br />
            return dsDevices;<br />
        }<br />



Here is output of the clsDebug.WriteString function:

Method: GetCustomerDevices
File:
Line: 63
Msg: Param name: @id, Param Type: Int, value is: 2762

Any help is appreciated
GeneralRe: SqlParameter problem Pin
Blue_Boy22-Apr-08 4:00
Blue_Boy22-Apr-08 4:00 
GeneralRe: SqlParameter problem Pin
Deian22-Apr-08 4:14
Deian22-Apr-08 4:14 
GeneralRe: SqlParameter problem Pin
Blue_Boy22-Apr-08 4:26
Blue_Boy22-Apr-08 4:26 
GeneralRe: SqlParameter problem Pin
Deian22-Apr-08 4:27
Deian22-Apr-08 4:27 
GeneralRe: SqlParameter problem Pin
Blue_Boy22-Apr-08 4:33
Blue_Boy22-Apr-08 4:33 
GeneralRe: SqlParameter problem Pin
Colin Angus Mackay22-Apr-08 10:28
Colin Angus Mackay22-Apr-08 10:28 

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.