Microsofts Data Access Application Block

Results 1 to 3 of 3

Thread: Microsofts Data Access Application Block

  1. #1
    Join Date
    Dec 1969

    Default Microsofts Data Access Application Block

    Hi, <BR>Has any one extensively used Microsofts Data Access Application Block. If so please help. <BR><BR>I am very new to Data Access Application Block but have a good knowledge of ASP. In my application i am using this block. I have a scenario <BR><BR>1. I added a reference of Data Access Application Block <BR>2. my application is an and c# application <BR>3. I have a login screen <BR>4. As soon user enters userid and password i call a function which has following code snippet <BR><BR>DataSet ds = new DataSet(); <BR>ds = SqlHelper.ExecuteDataset(_sDbConnectionString, CommandType.StoredProcedure, "sp_usermaster_sel"); <BR><BR>where _sDbConnectionString is a connection string declared and set above. <BR>5. Now my problem is how can i check how many records (RecordCount) are there in dataset(ds). <BR>6. Is there any option like what we used to have RS.RecordCount in ASP or alternate solution used to be checking RS.eof=true and RS.bof=true. <BR>7. Please give me a solution for this aand another thing is how to loop throught the dataset records without using datagrid. I would like to display the data in a tabular format in my page without using datagrid. <BR><BR>Thanks. <BR>Regards, <BR>Sri

  2. #2
    Join Date
    Dec 1969

    Default a few points

    It doesn&#039;t matter what you used to create the dataset, it is exactly the same if you use the building blocks or a dataadapter or populate it manually.<BR><BR>anyway, you can count them by doing<BR>dataSetName.Tables[0].Rows.Count.ToString()<BR><BR>If you just want to read thru the records perhaps a datareader would be better - very fast forward only, read only access to the data<BR><BR>then instead of checking for the end of the recordset as you do in classic asp you just do<BR><BR>while<BR>&#039;whatever<BR>loop<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Microsofts Data Access Application Block

    I don&#039;t know about MS Data Access Application Block but I do know a few things about dataset.<BR><BR>To get the record count of a dataset:<BR>NumOfRecords = ds.Tables[0].Rows.Count;<BR><BR>To loop through the dataset:<BR>for (int i=0; i &#060; NumOfRecords; i++)<BR>{<BR> Col1 = ds.Tables[0].Rows[i]["Column1"].ToString();<BR>}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts