User Profile

Collapse

Profile Sidebar

Collapse
shamaila
shamaila
Last Activity: Jul 21 '07, 09:56 AM
Joined: Jul 5 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • shamaila
    started a topic connection code in app-config file in windows form
    in .NET

    connection code in app-config file in windows form

    my connection code is:

    String strConnection;
    strConnection = "server=localho st;User ID=sa;Password= sas;database=db ";
    SqlConnection conn = new SqlConnection(s trConnection);
    conn.Open();

    how will i write it in any application configuration file working in windows form,and call it on every page that needs to b connected??
    can any body help me??
    See more | Go to post

  • shamaila
    started a topic update dataset
    in .NET

    update dataset

    i m using dataadapter to handle dataset..the date is shown in the datagrid..now i want to update the records edited by the user
    i have used one button to show the records,(in which i hv declared dataadapters and dataset)

    and behind "edit record" button i want to write the code for updation

    if i use the command

    DataAdapter.Upd ate(Dataset);

    what should i do as the dataadpter...
    See more | Go to post

  • shamaila
    started a topic wild card characters
    in .NET

    wild card characters

    wild card characters are used to match strings as
    select * from table where name LIKE '%brown%';
    but doesnt supports matching of dates,number
    what will we do if we want approximate matching of dates and numbers??
    See more | Go to post

  • shamaila
    replied to having problem in Select statement
    in .NET
    if(combobox2.te xt==" teachers name")
    str="t_name"; //giving field name
    //many if statements here

    strQuery = " SELECT * FROM tbl1,tbl2,tbl3 WHERE tbl1." + str + "=" + textBox1.Text+" AND

    tbl1.t_id=tbl2. tb_id AND tbl.t_id=tbl3.t b3_id ";

    it works
    but when i do

    //tablename=combo box1.text;
    //or
    tablename="tbl1 ";...
    See more | Go to post

    Leave a comment:


  • shamaila
    started a topic having problem in Select statement
    in .NET

    having problem in Select statement

    in my windows form,for search,two combo boxes are provided.the first one gives the table names and in second combo box the respective fields are provided ,by selecting any field the user enters the required value according to which te search is done

    i m storing both tablename and field name in string
    now in my select statement when i append the string with field name (with hard coded table name); it functions well but when...
    See more | Go to post

  • shamaila
    replied to fill dataadpter with more then one table
    in .NET
    thank u...but my code worked i.e.:

    strQuery = " SELECT * FROM tbl1,tble2 ";
    SqlCommand com1 = new SqlCommand(strQ uery, conn);


    DataSet ds = new DataSet();
    SqlDataAdapter da = new SqlDataAdapter( com1);
    da.Fill(ds, "tbl1");
    da.Fill(ds, "tbl2");
    ...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to fill dataadpter with more then one table
    in .NET
    well leave it i did it.......
    See more | Go to post

    Leave a comment:


  • shamaila
    started a topic fill dataadpter with more then one table
    in .NET

    fill dataadpter with more then one table

    i want to fill dataadapter with more then one table what will be the syntax for it and binding more then one datamembers(tab les) with grid
    See more | Go to post

  • shamaila
    replied to binding data to datagrid
    in .NET
    thx i'll try it now!!...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to binding data to datagrid
    in .NET
    hmmmm but as i told i m working in windows application and it doesnt support databind option
    is there any replacement or any directives/namespaces to include?
    and what if i want to update records using dataset?...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to binding data to datagrid
    in .NET
    well! isnt there any need to use data reader??
    well my code is

    //connection as conn

    strQuery = " SELECT * FROM table";
    SqlCommand com1 = new SqlCommand(strQ uery, conn);


    DataSet ds=new DataSet();
    SqlDataAdapter da=new SqlDataAdapter( );

    SqlDataReader dr = com1.ExecuteRea der();

    if (dr.Read())
    {

    da.Fill(ds,"tab le");...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to binding data to datagrid
    in .NET
    thank u but my prb is not yet solved......
    See more | Go to post

    Leave a comment:


  • shamaila
    started a topic binding data to datagrid
    in .NET

    binding data to datagrid

    in windows apllication, i want to select table's data and show it in datagrid
    but i dont undertand how will i bind the data
    is there any way to use datagrd view manager or something like this????
    m confused!!!
    See more | Go to post

  • connecting to sql server using application configuration file

    i m working on widows application..fo r connectivity to sql i want to give datasource in app file..and in every page i wan to call that string
    but i dont understand how to do that
    can anyone help me??
    See more | Go to post

  • shamaila
    replied to having problem in retrieving primary key
    in .NET
    hmm but i m not sure about that...can u plz clearify it?...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to having problem in retrieving primary key
    in .NET
    thx alot..its working now...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to having problem in retrieving primary key
    in .NET
    i tried it... there was no error on debugging but when i tried inserting values and clicked on save button the following exception was handled
    Index was outside the bounds of the array....
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to data adapter
    in .NET
    Error 1 The best overloaded method match for 'System.Data.Ol eDb.OleDbDataAd apter.OleDbData Adapter(string, string)' has some invalid arguments


    Error 2 Argument '2': cannot convert from 'System.Data.Sq lClient.SqlConn ection' to 'string'...
    See more | Go to post

    Leave a comment:


  • shamaila
    replied to having problem in retrieving primary key
    in .NET
    but is not working with that......
    See more | Go to post

    Leave a comment:


  • shamaila
    started a topic data adapter
    in .NET

    data adapter

    i m creating a data adapter but is not working..is it the correct way??

    [CODE=css] OleDbDataAdapte r da = new OleDbDataAdapte r(strQuery, conn);
    da.Fill(ds, "table name");[/CODE]
    See more | Go to post
    Last edited by r035198x; Jul 6 '07, 07:04 AM. Reason: I'm crazy about code tags
No activity results to display
Show More
Working...