Click here to Skip to main content
15,887,821 members
Home / Discussions / C#
   

C#

 
GeneralRe: Question about AutoResetEvent Pin
Xmen Real 20-Sep-09 6:45
professional Xmen Real 20-Sep-09 6:45 
QuestionTransparency on moving controls? Pin
Sindicoro19-Sep-09 20:09
Sindicoro19-Sep-09 20:09 
AnswerRe: Transparency on moving controls? Pin
Henry Minute19-Sep-09 20:57
Henry Minute19-Sep-09 20:57 
QuestionHelp with passing an array to a method Pin
Ceceily19-Sep-09 18:01
Ceceily19-Sep-09 18:01 
AnswerRe: Help with passing an array to a method Pin
Luc Pattyn19-Sep-09 18:13
sitebuilderLuc Pattyn19-Sep-09 18:13 
GeneralRe: Help with passing an array to a method Pin
Ceceily19-Sep-09 18:32
Ceceily19-Sep-09 18:32 
GeneralRe: Help with passing an array to a method Pin
Ceceily19-Sep-09 19:18
Ceceily19-Sep-09 19:18 
Questionretreiving values from datatable Pin
Rabia_Arif19-Sep-09 17:53
Rabia_Arif19-Sep-09 17:53 
Hello.
I m using C# and sql server2005
I want to retrieve values from Datatable but dt kno how to do this.
My code is as follows,it checks from view(since it is the combination of specific columns from 2 tables)that whether the a particular service is reserved for the next day or not:



 dtTableRecords_out = null;
            string strQueryString = null;
            SqlCommand objSqlCommand = null;
            SqlConnection objSqlConnection = null;
            DataSet objDataSet = null;
            SqlDataAdapter objDataAdapter = null;
            SqlDataReader objDataReader = null;
            string day = (DateTime.Now.AddDays(1).Day.ToString());
            string month = (DateTime.Now.Month.ToString());
            string year = (DateTime.Now.Year.ToString());
            string date_nextDay = month + '/' + day + '/' + year;

            try
            {
                objDataSet = new DataSet();
                objDataAdapter = new SqlDataAdapter();
                objSqlConnection = new SqlConnection(ConnectionString.GetSQLConnectionString());
                strQueryString = "select * from view_reservation where  date = " + date_nextDay;
                objSqlCommand = new SqlCommand(strQueryString, objSqlConnection);

                objDataAdapter.SelectCommand = objSqlCommand;
                objSqlConnection.Open();
                objDataSet.Clear();

                objDataAdapter.Fill(objDataSet);
                objSqlConnection.Close();
                dtTableRecords_out = objDataSet.Tables[0];

               if (strQueryString != null)
                {
                    Console.WriteLine("Service is reserved for tommorow");
                }
                else
                {
                    Console.WriteLine("no reervation");

                }
   
            }

            finally
            {

                if (objSqlConnection.State == ConnectionState.Open)
                {
                    objSqlConnection.Close();
                }

            }
            return strQueryString;
}

but the if statement is not executiong correctly.
I want the result(eg service_name or customer_id) from the query for further processing.

Hope that u ppl will provide me with an answer.I am sorry i forgot to put my code inside code block
AnswerRe: retreiving values from datatable Pin
Henry Minute19-Sep-09 21:15
Henry Minute19-Sep-09 21:15 
GeneralRe: retreiving values from datatable Pin
Rabia_Arif21-Sep-09 21:09
Rabia_Arif21-Sep-09 21:09 
AnswerRe: retreiving values from datatable Pin
Patrik.karlin20-Sep-09 0:42
Patrik.karlin20-Sep-09 0:42 
Questionhow to printpriview the datagridview data in c# Pin
Ramesh Reddy1111119-Sep-09 16:57
Ramesh Reddy1111119-Sep-09 16:57 
AnswerRe: how to printpriview the datagridview data in c# Pin
Christian Graus19-Sep-09 17:04
protectorChristian Graus19-Sep-09 17:04 
QuestionC# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
jasonandrew19-Sep-09 14:08
jasonandrew19-Sep-09 14:08 
AnswerRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
73amit17-Sep-10 0:45
73amit17-Sep-10 0:45 
AnswerRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
AshokNaik10-Jul-11 21:45
AshokNaik10-Jul-11 21:45 
QuestionRe: C# Word Interop - Insert Image into a specific cell in a table located in the document header Pin
Member 110410579-Mar-15 0:50
Member 110410579-Mar-15 0:50 
QuestionImage position in other image c# ? [modified] Pin
sodevrom19-Sep-09 12:29
sodevrom19-Sep-09 12:29 
AnswerRe: Image position in other image c# ? Pin
Dave Kreskowiak19-Sep-09 14:01
mveDave Kreskowiak19-Sep-09 14:01 
GeneralRe: Image position in other image c# ? Pin
sodevrom19-Sep-09 14:06
sodevrom19-Sep-09 14:06 
GeneralRe: Image position in other image c# ? Pin
Dave Kreskowiak19-Sep-09 14:13
mveDave Kreskowiak19-Sep-09 14:13 
GeneralRe: Image position in other image c# ? Pin
Alan Balkany21-Sep-09 10:12
Alan Balkany21-Sep-09 10:12 
AnswerRe: Image position in other image c# ? Pin
Albond22-May-10 10:27
Albond22-May-10 10:27 
QuestionHow to monitor key pressed? Pin
p3rson19-Sep-09 11:06
p3rson19-Sep-09 11:06 
AnswerRe: How to monitor key pressed? Pin
Christian Graus19-Sep-09 11:19
protectorChristian Graus19-Sep-09 11:19 

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.