Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
QuestionCustomer Grid View Pin
Syed Shahid Hussain14-Sep-09 23:59
Syed Shahid Hussain14-Sep-09 23:59 
AnswerRe: Customer Grid View Pin
Henry Minute15-Sep-09 1:48
Henry Minute15-Sep-09 1:48 
GeneralRe: Customer Grid View Pin
Syed Shahid Hussain15-Sep-09 2:56
Syed Shahid Hussain15-Sep-09 2:56 
GeneralRe: Customer Grid View Pin
Henry Minute15-Sep-09 3:05
Henry Minute15-Sep-09 3:05 
Questionhide the text in specified position? Pin
raj23136214-Sep-09 23:26
raj23136214-Sep-09 23:26 
AnswerRe: hide the text in specified position? Pin
musefan14-Sep-09 23:37
musefan14-Sep-09 23:37 
GeneralRe: hide the text in specified position? Pin
raj23136214-Sep-09 23:48
raj23136214-Sep-09 23:48 
QuestionPassing a table (DataTable) value as a parameter to stored procedure Pin
sanjubaba14-Sep-09 23:22
sanjubaba14-Sep-09 23:22 
Hi,
   I am trying to pass a datatable as a parameter to a stored procedure. my sql server is 2008.
Also my database transactions happens with the class from enterprise library January 2006.
Following is my code:

DataTable dt = new DataTable();

                  DataColumn dcol = new DataColumn("Col1", typeof(int));
                  dt.Columns.Add(dcol);

                  DataRow dr;
                  dr = dt.NewRow();
                  dr["Col1"] = 1;

                  dt.Rows.Add(dr);

                  SqlParameter parameter = new SqlParameter("@MenuRights", SqlDbType.Structured);
                  parameter.Value = dt;

                  DataTable dtbl = ExecuteDatabaseQuery.Reference.ExecuteQuery_DataTable(ConAdmin, "teststorepro", "teststorepro",
                        ProjectConstants.QueryType.StoredProc, null, true, null,
                        parameter);

When the sqlcommand is made and passed for executing, it throws an error
"Failed to convert parameter value to IEnumerable".

Following is the code from enterprise library:

Database db = (Database)CreateConnection(ConnectionName);

                        if (WriteInfoInLogFile == true && WriteToLogs == true)
                        {
                              CLogger.Reference.sLogInfo(ConnectionName, OptionName, oQuery, TypeOfQuery, CLogger.EStatus.StartProcess, LogMsg, CLogger.MsgType.Information, SQLParams);
                        }

                        DbCommand cmd = (DbCommand)CreateCommand(db, oQuery, TypeOfQuery, cmdTimeOutMin, SQLParams);

                        DataSet dstStorePro = db.ExecuteDataSet(cmd);

                        if (dstStorePro.Tables.Count > 0)
                        {
                              int TableCount = dstStorePro.Tables.Count;
                              for (int i = 0; i < TableCount; i++)
                              {
                                    DataTable dtbl = dstStorePro.Tables[i];
                                    Boolean HasMsg = GetStoreProMessage.GetMessage(dtbl);

                                    if (HasMsg == false)
                                    {
                                          dt = dtbl;
                                    }

                              }
                        }
when the command is passed to db.ExecuteDataSet(cmd); , it throws the above error.

Sandeep Kumbhar

AnswerRe: Passing a table (DataTable) value as a parameter to stored procedure [modified] Pin
sanjubaba15-Sep-09 17:26
sanjubaba15-Sep-09 17:26 
Questionusing google api in c#.net for google ad-sense search Pin
Anil Veeraghattapu 414-Sep-09 23:05
Anil Veeraghattapu 414-Sep-09 23:05 
AnswerRe: using google api in c#.net for google ad-sense search Pin
Pete O'Hanlon14-Sep-09 23:41
mvePete O'Hanlon14-Sep-09 23:41 
GeneralRe: using google api in c#.net for google ad-sense search Pin
Anil Veeraghattapu 415-Sep-09 0:22
Anil Veeraghattapu 415-Sep-09 0:22 
Questionhow to determine if you control is inside a panel or not? Pin
TheCardinal14-Sep-09 23:03
TheCardinal14-Sep-09 23:03 
AnswerRe: how to determine if you control is inside a panel or not? Pin
dan!sh 14-Sep-09 23:07
professional dan!sh 14-Sep-09 23:07 
JokeRe: how to determine if you control is inside a panel or not? Pin
Greg Chelstowski14-Sep-09 23:10
Greg Chelstowski14-Sep-09 23:10 
GeneralRe: how to determine if you control is inside a panel or not? Pin
dan!sh 15-Sep-09 2:57
professional dan!sh 15-Sep-09 2:57 
GeneralRe: how to determine if you control is inside a panel or not? Pin
Greg Chelstowski15-Sep-09 3:05
Greg Chelstowski15-Sep-09 3:05 
GeneralRe: how to determine if you control is inside a panel or not? Pin
dan!sh 15-Sep-09 3:27
professional dan!sh 15-Sep-09 3:27 
AnswerRe: how to determine if you control is inside a panel or not? Pin
Greg Chelstowski14-Sep-09 23:09
Greg Chelstowski14-Sep-09 23:09 
AnswerRe: how to determine if you control is inside a panel or not? Pin
TheCardinal14-Sep-09 23:11
TheCardinal14-Sep-09 23:11 
Questionwriting values to device in WinCE os through serial port Pin
arun_pk14-Sep-09 22:38
arun_pk14-Sep-09 22:38 
Questionhow to restrict the user from entering numbers or any special char.... Pin
amaankhan14-Sep-09 22:29
amaankhan14-Sep-09 22:29 
AnswerRe: how to restrict the user from entering numbers or any special char.... Pin
DaveyM6914-Sep-09 22:40
professionalDaveyM6914-Sep-09 22:40 
QuestionHow to call Google API Pin
Nekkantidivya14-Sep-09 22:18
Nekkantidivya14-Sep-09 22:18 
AnswerRe: How to call Google API Pin
benjymous14-Sep-09 22:40
benjymous14-Sep-09 22:40 

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.