Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
R

Rabia_Arif

@Rabia_Arif
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • string is not recognized
    R Rabia_Arif

    Oh thankyou all 4 sharing your ideas.My problem is solved:) thanks a lot

    C# database csharp help

  • string is not recognized
    R Rabia_Arif

    hello, I am using Visual c# 2005 and sql server2005 In my project I have to use the next date from the current system and have to use it in the where clause of sql query string for that i did the following:

    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;

    then in sql query my code looks like this:

    strQueryString = "select * from view_reservation where date =" + date_nextDay.ToString();

    but the problem is sql is not recognizing it although there are some rows in database and whenever I just write the next day date in single quotes by myself it works correctly.Dont kno what to do

    C# database csharp help

  • retreiving values from datatable
    R Rabia_Arif

    thankyou people 4 ur interest Yes i usually use parameter classes for sql queries.I will use that here after the correct operation of my code. I have also tried the code of what u suggested but still output is incorerct.Although whenever i execute the query in sql it returns me some rows. I have also tried with SqlDataReader but DataReader remains null:(

    C# database csharp sales tutorial

  • retreiving values from datatable
    R Rabia_Arif

    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

    C# database csharp sales tutorial

  • using console application as service
    R Rabia_Arif

    hello; I have a problem using console application.I mostly use Windows application. I m using C# 2005 and Sql server2005 as part of my project.I am using 3layered architecture i have method in Business class: public static int DataSelectionForAutoGeneratedMsg(string strTableName, out List<string> strContactNos) Because i have to check that if a customer has his reservation booked for next day then he should be reminded for that.For that our service (which i m intended to built using console app) keep checking in the reservation table having columns(cust_id,reservation_date,service_name) . then if the result of the query is correct i.e if it returns datatable then it has to send sms to that customer.Below is the code but i have not included the coding for sending sms here.Instead of that i have just used the Console.Writeline statement so that atlaest this par works also i have not included the coding of internal class ConnectionString Hope the information will be enough for u to understand Code: using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Collections; using System.Data.SqlClient; using HRCF.BL;// adding Business logic using HRCF.DB;//adding database using System.ComponentModel; namespace ConsoleApp_service { public class services { //private CHRCFDB m_objCHRCFDB = null; public services() { //m_objCHRCFDB = new CHRCFDB(); } static void Main(string[] args) { Console.WriteLine("Reading this line"); //dont kno wheather th efollowing line of code is correct or not.It gives no error but no output as well!! string result = Checkingreservation("reservation", out dtTableRecords_out); } public static string CheckingReservation(string strTableName, out DataTable dtTableRecords_out) { string strQueryString = ""; SqlCommand objSqlCommand = null; SqlConnection objSqlConnection = null; DataSet objDataSet = null; SqlDataAdapter objDataAdapter = null; // checking from the current date string ritenow = Convert.ToString(System.DateTime.Now); try { objDataSet = new DataSet(); objDataAdapter = new SqlDataAdapter(); objSqlConnection = new SqlConnection(ConnectionString.GetSQLConnectionString()); strQueryString = "select cust_i

    C# database help csharp business sales
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups