Saturday, February 1, 2014

how to implement the function in c#

I am converting the code form vb.net to c#.In vb.net if you pass typed dataset from entity to dataaccess haivng the untyped dataset it is accepting but in c# if you pass it is not accepting.through google i found one function i dont know how to implement.


I would like to implement the below Interface function:


int ExecuteDataAdapterDataTableWithParams(IDbCommand podbCommand, ref T pdtDataTable) whereenter code here` T : DataTable;



I would like to implement like mentioned below. I need both the number of rows and datatable.



public int ExecuteDataAdapterDataTableWithParams(IDbCommand podbCommand, ref DataTable pdtDT)
{
IDataAdapter ldaDataAdapter = default(IDataAdapter);
IDbTransaction lodbTrans = default(IDbTransaction);
int liFetchedRows = 0;
lodbTrans
= EstablishConnection();
try
{
podbCommand
.Connection = coConnection;
podbCommand
.Transaction = lodbTrans;
ldaDataAdapter
= GetDataAdapter(ref podbCommand);
ldaDataAdapter
.TableMappings.Add("Table", pdtDT.TableName);
liFetchedRows
= ldaDataAdapter.Fill(pdtDT.DataSet);
}
catch (Exception ex)
{
throw (ex);
}
finally
{
CloseConnection(ref lodbTrans);
}
return liFetchedRows;
}



Untyped dataset param not accepting typed dataset in c#

How did you implement the interface?


How did you call that?




ASP.NET Questions

Other Discussions

FreeRice Donate

Issues to report

Free Tech Books Search


Untyped dataset param not accepting typed dataset in c#

A typed data set is a class which derives from DataSet. Same thing for a table that's part of the typed data set.


Normally you are able to pass an object of a derived type to a function parameter which expects a objects of the base type. But in your case you are using 'ref' and in this case the only acceptable type is the parameter type, DataTable.


The only way to solve this is to change ExecuteDataAdapterDataTableWithParams. Something like the following might work but it really depends on what code you have in that method:


int ExecuteDataAdapterDataTableWithParams<T>(IDbCommand podbCommand, ref T pdtDataTable) where T : DataTable;


Untyped dataset param not accepting typed dataset in c#

Yes you are correct but i am taking number of rows and datatable also from the function. Please tell me how can i implement the below function.


int ExecuteDataAdapterDataTableWithParams<T>(IDbCommand podbCommand, ref T pdtDataTable) where T : DataTable;

How create animated power view reports using sharepoint list as a data source in sharepoint 2010?

Hi All,


I got a client requirement to create reports using SharePoint List as data source. The report should show reflection depends on values changed (I mean animation).


I have heard about the power view/power pivot which does this kind of animations in reports.


Can someone please guide me on creating reports which shows animations



  1. In power view/power pivot using SharePoint List as data source in SharePoint 2010.


Thanks in advance.




MercuryMan


Table inheritance in SQL ?

I would personally consider the open / close principle in OOP and apply it to the DB in a similar way. It might break some normalisation rules (im not sure) but it goes like this.


Create a battery table with the fields you want that are common to the other tables.


Next create a new table for each sub-type of battery.


Then link each sub table with the base table using a one to one relationship.


By specifying the relationship cascading rules right, you will not have to use triggers or views so all your code is obvious.


It does mean you will have to use joins to get at all the data but I dont see that as breaking any big bad rules. To me its logical as two tables are involved, so you create a join when needed.


Note: Im not suggesting there is anything wrong with triggers or views approach as recommended here. I just wanted to put an alternative forward.


I would welcome any suggestions on the pros and cons of this over other ideas as I am learning too. Thanks.

Customized form opening in a dialog box

Hi All,



I have customized a form for the Document library .



after saving the details it is saved to document library however when i open any item it just opens the document name to edit instead of all other fields.



could you please give me steps on how to open the complete content type to be viewed and edited.



Also can this be opened in a modal dialog instead of a new page.



Navy