CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.getting_started Tags:
Item Type: NewsGroup Date Entered: 1/31/2004 6:39:48 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 10 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
Laura D
Asp.Net User
IBS v DNN Data access methods - please clarify1/31/2004 6:39:48 PM

0/0

Hi folks,

As an example from IBS the following announcements code reads to me perfectly clearly like plain English ... however I am completely unclear about the DNN coding version of this .... can anyone clarify for me ... I can't see what is happening with the parameters here at all here as I am very familiar with IBS and not DNN.

Any eyeopeners welcome.

Laura D



Public Function GetAnnouncementsAsDataSet(ByVal moduleId As Integer) As DataSet

' Create Instance of Connection and Command Object
Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim myCommand As New SqlDataAdapter("GetAnnouncements", myConnection)

' Mark the Command as a SPROC
myCommand.SelectCommand.CommandType = CommandType.StoredProcedure

' Add Parameters to SPROC
Dim parameterModuleId As New SqlParameter("@ModuleId", SqlDbType.Int, 4)
parameterModuleId.Value = moduleId
myCommand.SelectCommand.Parameters.Add(parameterModuleId)

' Create and Fill the DataSet
Dim myDataSet As New DataSet()
myCommand.Fill(myDataSet)

' Return the DataSet
Return myDataSet

End Function



Public Function GetAnnouncements(ByVal ModuleId As Integer) As SqlDataReader

' Create Instance of Connection and Command Object
Dim myConnection As New SqlConnection(GetDBConnectionString)

' Generate Command Object based on Method
Dim myCommand As SqlCommand = SqlCommandGenerator.GenerateCommand(myConnection, _
CType(MethodBase.GetCurrentMethod(), MethodInfo), _
New Object() {ModuleId})

' Execute the command
myConnection.Open()
Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)

' Return the datareader
Return result

End Function


bhopkins
Asp.Net User
Re: IBS v DNN Data access methods - please clarify2/1/2004 9:49:59 PM

0/0

Laura, THe main difference between these two functions is the way the DB is called. Shaun created the SQLCommandGenerator class to handle some of the parameter settings, etc.. It makes it easier to code, because you do not have to worry about all the intricies of passing the parameters. If you notice the Method name is the same as the stored procedure and that is how it knows which stored proc to use. Of course none of this is really valid any more with 2.0 so I would nto spend a lot of time worry about figuring it out, unless you have no plans to migrate to DNN 2 when we release it.


hth Bruce
DynamicVB.Net
aus_nexxus
Asp.Net User
Re: IBS v DNN Data access methods - please clarify2/13/2004 5:04:04 PM

0/0

The data access in Version 2 is a lot harder to understand at first and inf=general you would not be able to read it like plain english. But it is much better with extensive use of caching to minimise database calls like the one you show.
Also we no longer use the data reader object above the Business Logic Layer as we now create an Arraylist of custom objects. Which agina gives better performance and is a more object Oriented way of writing code.

Anotehr advantage is the DNN 2 can connect to other types of databases apart from SQL Server simply by selecting the Data Provider in the web config file. Of course you will need a data provider for each database type but the code in DNN proper does not change only the code in the data provider.

Have a read of the Data Access paper on the dnn site.

Cheers
Philip Beadle (MVP, MCAD, DotNetNuke Core Team)









3 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
JobBankUSA.com's Resume Broadcaster Employer / Recruiter List Please use your browser's BACK button to return. ...... Data Access Technologies . Data Alliance. Data Alliance Consultants. Data Careers Network ...
Abbreviations List by FakeNewspapers.com ALM -----AudioLingual Method (in teaching a foreign language) AVA ----- AudioVisual Aids ...... DAL -----Data Access Line DAM -----Data Access Manager ...
re: Getting the book published - Jeff's Junk Usually the data access layer throws an exception (since using "magic" values ...... I agree that the complexity of the Forums, and things like IBS and DNN, ...
Untitled ring the reciprocal access to data on. energy and to energy data basis. ..... Algerian side as “a sound method that allows the quotas. to be shared fairly”. ...
URL's for Reference NET.4GuysFromRolla.com: Working with the Enterprise Library's Data Access Application Block: This article, by Scott Mitchell, examines the Data Access ...
1and1 Review, User Reviews of 1and1 I finally download the raw data files and open them with NotePad. Can you believe it, that this method more "user friendly" and informative? ...
Daily Kos: ACTION REQUIRED: Executive Power Grab in Banking Bail ... and give them this link and tell them to PLEASE rec this diary. ...... TO CLARIFY. Look, right now the choice is, Bush's Plan, or Something Else. ...
Full text of "TITLE LIST OF DOCUMENTS MADE PUBLICLY AVAILABLE VOL ... In particular, if there are title descriptions that are not meaningful, please let us know so that we can correct the data base. In so far as possible, ...
From [email protected] Wed Oct 2 22:40:53 2002 Return-Path ... Please provide error messages, version info etc. See the attached files. ...... 2wb8chmLffxhOci3W2sMfx4Y+DkbfN828zF7mpPlDDv05dmdz2cAcEBM+IBS/dv+7/T3xxt0B7sg ...
ARCCA - BLOG HB 1815 was actually passed to clarify some issues left dangling by a ...... refinance vs home equity ...




Search This Site:










kerberos authentiation help...?

3.0.13 issue: wizard (common tasks)

instalation problem

advanced data bindings question

dnn - windows authentication - diff internal domain name than external

menu.pathseparator invisible

content management?

grid view updating in asp.net 2.0

error in mobiledefault.aspx

vs2008 executable size, 50% increase?

multilingual + masterpage

3.0.10 issue: error during creation of portal

how to get user profile using sqlstoredprocedureprofileprovider

webresource problems

dnn malaysia - how many company implement ?

what is a token id?

where is virtual path setting located?

roles and users

windows 2003

ldapauthentication in asp.net 2.0

"random module" module

creating a login the new/old way

clearing all fields on a web form

membership password

error displaying images on hosted site

dnn 3.0.12- codesmith template problem

rss module link problem

microsoftajax.js - no such interface supported error

user's machine address

unknown error 0x80005000

 
All Times Are GMT