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
R

ronin1770

@ronin1770
About
Posts
18
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Storing Some settings in Registry
    R ronin1770

    Hi, I got a quick question : Is there any way to store Maximimze/Minimize Size and Location of form in Registry? So upon restart - it would read those values from registry and return to its former state thanx in advance

    C# question windows-admin

  • Datasets and Web Services
    R ronin1770

    HI, I am trying to build a simple web services which simply get list of employee's last name from Sql server's database. The method in web-service class is supposed to read the data from the db and return the results in a form of DataSet and it is defined as : --------------------------------------- //a web method which retrieves data (last names of about given //thing in form of a data set [WebMethod(BufferResponse=true)] public DataSet getLastNames() { //string var representing sql string string sql = ""; //create a new temp dataset DataSet ds = new DataSet(); try { //open the connection scConn.Open(); //create the sql sql = "SELECT LastName FROM tblEmployees"; //create the command cmd = new SqlCommand(sql,scConn); //create the sql data adapter SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(ds,"Employees"); Console.WriteLine(ds.Tables.Count); //clean up code sda=null; cmd=null; scConn.Close(); return ds; } catch(Exception ex) { Console.WriteLine(ex.ToString()); } } ---------------------------------------------------- I want to display the data from the dataset in a DataGrid (in a Windows Form) in a DataGrid. Window form also contains one button which calls webmethod and fills out datagrid. The code is given as : --------------------------- private void cmdConnect_Click(object sender, System.EventArgs e) { try { DataSet ds = new DataSet(); localhost.wsEmployees ws = new wsEmployeesClient.localhost.wsEmployees(); ds = ws.getLastNames(); Console.WriteLine(ds.Tables[0].Rows); } catch(Exception ex) { Console.WriteLine(ex.ToString()); } } ------------------------------ note localhost = name of web reference ----------------------------------- Problem : No records can be found. There is no table in dataset. I just want to know what i am doing WRONG. Am I missing out something either in code or IIS Server's Administration. thanx in advance

    C# database sql-server wcf sysadmin windows-admin

  • accessing database using webservice
    R ronin1770

    wanna explore this any sample code for this topic..... thanx in advance

    C# database

  • Custom Control
    R ronin1770

    ok ... i am trying to create Custom Control (which later can be added to VS.NET tool box and added to any windows form). This custom control contains a data-grid. I want to implement the following functionality : when user resizes this custom control he/she should be able to see control (i.e., data grid) resizing, like in the case of typical/intrinsic controls (text box). when we resize them ... we can see them their size changes. second thing i want to do is that : as soon as this control is added to a windows form, a wizard is launched which allows customization. i don't know how to implement this behavior... and where should i start? any suggestions

    C# csharp css visual-studio tutorial question

  • is there any way to remove (Side header) from datagrid control
    R ronin1770

    thanx for the reply...

    C# css

  • is there any way to remove (Side header) from datagrid control
    R ronin1770

    Ok.. i want to remove the side header (well.. where cursor appears to indicate the selected row) from the data grid control.... is there any way to remove it or is there any way to reduce it's width... if you don't understand what i mean... please email me i will forward you the pic. thanx in advance

    C# css

  • problem with SQL
    R ronin1770

    HI, i am trying to retreive records for order with in a specified range of dates. I have created sql string as follows : //create the sql sql = "SELECT * FROM vShipments WHERE DateOrdered BETWEEN'" + txtOrderDateFrom.Text + ", '" + "AND '" + txtOrderDateTo.Text + "'"; ------------------------------------------- On execution, i am getting following error(s) : System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. at System.Data.SqlClient.SqlDataReader.Read() at InventoryControl.frmShipments.PopulateListView(String filter) in d:\shirtuniverse\inventorycontrol\frmshipments.cs:line 786 ------------------------------------------------------------ Any idea(s) : what i am doing wrong Thanx in advance

    C# help database

  • Problem with Stored Procedure
    R ronin1770

    hi, i am writing a simple Stored Procedure [Sql Server 2000] to check employee's login ... this stored procedure.. supposed to return "YES" or "NO.. if login and password match... here is the code for stored procedure : ---------------------------------- CREATE PROCEDURE spCheckEmpLogin @Login char(6), @EmpPassword char(8) , @RetVal char(3) OUTPUT AS DECLARE @tmp char(4) SELECT @tmp = EmpPassword FROM tblEmployees WHERE Login=@Login IF @tmp <> @EmpPassword BEGIN @RetVal = 'NO' END RETURN; GO --------------------------------------- when i click on "Check Syntax" button.... server returns this error : Error 170: Line 11 : Incorrect Syntax near '@RetVal' ...................................................... well ... in line 11 : i am assigning 'No' to @RetVal... [it's a simple assignment].... can you please tell me what i am doing wrong???? thanx in advance

    C# database help sql-server sysadmin regex

  • adding command button column to ListViewControl
    R ronin1770

    Hi, I want to add a Column containing Command Buttons to ListView Control... is it even possible... can i have some sample code... thanx in advance

    C#

  • Popping Up Context Menu
    R ronin1770

    hi, I am just wondering how can i make Context Menu pop-up.. only if an item is selected in a ListView Control.... any help will be greatly appreciated... thanx

    C# help question

  • Problem with stored procedure/C# code
    R ronin1770

    thanx

    C# database help csharp

  • Problem with stored procedure/C# code
    R ronin1770

    Hi, i have created a stored procedure which returns number of un-read memo(s)..... stored procedure's code : ---------------------------- CREATE PROCEDURE spNumOfUnReadMemos @EmpTo char(6), @NumOfUnReadMemos int OUTPUT AS SELECT COUNT(EmpTo) FROM tblMemoManagement WHERE EmpTo=@EmpTo AND ReadYesNo='NO' RETURN; GO --------------------------------------- Then i have a C# Class which access this stored procedure as public int getNumUnReadMemos() { int retVal=0; try { //create the sql sql = "spNumOfUnReadMemos"; //open the connection gICVars.scInCtrl.Open(); //create the command cmdMemo = new SqlCommand(sql,gICVars.scInCtrl); cmdMemo.CommandType=CommandType.StoredProcedure; //create the parameters cmdMemo.Parameters.Add("@EmpTo", SqlDbType.Char,6); cmdMemo.Parameters[0].Value=this.getToEmp(); cmdMemo.Parameters.Add("@NumOfUnReadMemos", SqlDbType.Int,4); cmdMemo.Parameters[1].Direction=ParameterDirection.Output; //execute the non-query cmdMemo.ExecuteNonQuery(); //retrieve the value of NumOfUnReadMemos Console.WriteLine(cmdMemo.Parameters[1].Value); //retVal = int.Parse(cmdMemo.Parameters[1].Value.ToString()); Console.WriteLine(cmdMemo.Parameters[1].Value); //clean up code cmdMemo.Dispose(); sql=null; gICVars.scInCtrl.Close(); return retVal; } catch(Exception ex) { Console.WriteLine(ex.ToString()); return -1; } } ---------------------------------------------- whenever i tried to execute this code .. i got following error.... System.FormatException: Input string was not in a correct format. at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider) at System.Int32.Parse(String s) at InventoryControl.cMemo.getNumUnReadMemos() in d:\shirtuniverse\inventorycontrol\cmemo.cs:line 380 ------------------------ any idea(s)... y i am getting this error THANX in advance

    C# database help csharp

  • Problem with Stored Procedure's Return value
    R ronin1770

    Hi, I am using a Stored Procedure to validate Login Process: Stored Procedure is defined as follows : ---------------------------------------------------------- CREATE PROCEDURE spCheckLogin @LoginID char(20), @Pwd char(8), @Response int OUTPUT AS IF EXISTS (SELECT * FROM tEmployees WHERE LoginID=@LoginID AND Pwd=@Pwd) Return 1 ELSE Return 0 GO ---------------------------------------------------------- In C#, I am accessing this Stored Procedure as follows: try { string temp=""; //open the connection gvDatabase.scInventoryControl.Open(); //create the sql sql = "spCheckLogin"; //create command cmdLogin = new SqlCommand(sql,gvDatabase.scInventoryControl); cmdLogin.CommandType=CommandType.StoredProcedure; cmdLogin.Parameters.Add("@LoginID", SqlDbType.Char,20); cmdLogin.Parameters["@LoginID"].Value=log; cmdLogin.Parameters.Add("@Pwd", SqlDbType.Char,8); cmdLogin.Parameters["@Pwd"].Value=p; cmdLogin.Parameters.Add("@Response",SqlDbType.Int,4); cmdLogin.Parameters["@Response"].Direction=ParameterDirection.Output; Console.WriteLine("Data Access started"); cmdLogin.ExecuteNonQuery(); temp = cmdLogin.Parameters["@Response"].Value.ToString(); Console.WriteLine(temp); //clean up code cmdLogin.Dispose(); gvDatabase.scInventoryControl.Close(); Console.WriteLine("Data Access Closed"); } catch(Exception ex) { Console.WriteLine(ex.ToString() ); } ------------------------------------------------------------ However It doesn't print any values, although I values do exists in the table What am i doing wrong? ThANX in ADvance

    C# database csharp help question

  • Extending Windows.Form DataGrid class
    R ronin1770

    HI, I want to extend Windows.Forms.DataGrid class so I can add buttons to data grid's columns. I haven't found any good sample of this over the internet... if any body has link to a better example/sample - please forward me that URL thanx in advance:(

    C# css tutorial

  • Problem with Stored Procedure
    R ronin1770

    THANX it worked

    C# database help csharp sql-server sysadmin

  • Problem with Stored Procedure
    R ronin1770

    HI, i tried the way u suggested... it was never the order of fields but no success so far... it is beyond my understanding... probably problem with SQL Server Instance

    C# database help csharp sql-server sysadmin

  • Problem with Stored Procedure
    R ronin1770

    Hi, I am using a C# code to insert a data in SQL Server. Stored Procedure which inserts data is created as : ----------------------------------------- CREATE PROCEDURE spAddNewAddress @AddressID char, @AddressType char, @HomeAddress varchar, @City varchar, @State varchar, @Zip varchar, @Country varchar AS INSERT INTO Address VALUES(@AddressID, @AddressType, @HomeAddress, @City, @State, @Zip, @Country) GO ----------------------------------------- Then C# code which inserts data is : public void insertNewData(Address a) { try { //create sql string sqlAddress = "spAddNewAddress"; //Open the connection scAddress.Open(); //create the cmdAddress cmdAddress = new SqlCommand(sqlAddress, scAddress); cmdAddress.CommandType = CommandType.StoredProcedure; //adding parameters for command cmdAddress.Parameters.Add("@AddressID",SqlDbType.Char,10); cmdAddress.Parameters["@AddressID"].Value = a.getAddressID(); cmdAddress.Parameters.Add("@AddressType",SqlDbType.Char,1); cmdAddress.Parameters["@AddressType"].Value=a.getAddressType(); cmdAddress.Parameters.Add("@HomeAddress",SqlDbType.VarChar,100); cmdAddress.Parameters["@HomeAddress"].Value=a.getHomeAddress(); cmdAddress.Parameters.Add("@City",SqlDbType.VarChar,25); cmdAddress.Parameters["@City"].Value=a.getCity(); cmdAddress.Parameters.Add("@State",SqlDbType.VarChar,25); cmdAddress.Parameters["@State"].Value=a.getState(); cmdAddress.Parameters.Add("@Zip",SqlDbType.VarChar,25); cmdAddress.Parameters["@Zip"].Value=a.getZip(); cmdAddress.Parameters.Add("@Country",SqlDbType.VarChar,70); cmdAddress.Parameters["@Country"].Value=a.getCountry(); cmdAddress.ExecuteNonQuery(); //clean up code cmdAddress.Dispose(); scAddress.Close(); } catch(Exception ex) { Console.WriteLine(ex.ToString() ); } ----------------------------------------- Code executes with out any trouble (no breaks/errors or exceptions). Only problem is when i try to view this data in SQL Server's Enterprise Manager, only first letter of the inserted data appears. e.g : If inserted AddressCode = A03C0001 then in the EnterPrise Managers it appears as : "A". Another strange thing, if try to query database with AddressCode="A", it generates error (that data don't exists). Although If you try to query database with AddressCode="A03C0001", then it extracts complete information as inserted. any suggestions!!!!!

    C# database help csharp sql-server sysadmin

  • Retrieving POP3 message
    R ronin1770

    Hi, i am kind of building an application (somewhat like Outlook express) which retrieves messages from Pop3 server.. but the retrieved message have alot of other information (i believe it is called HEADER INFORMATION)... my question : IS there any way to strip this header information... any help will be appreciated thanx in advance

    C# sysadmin help question
  • Login

  • Don't have an account? Register

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