You need to Register for free and Login to post a message in the forum.

Forum

Subject: Javascript and Databases
Prev Next
You are not authorized to post a reply.

Author Messages
ALEXw
Nuker
Nuker
Posts:19

01 Oct 2007 12:39 PM  
Hi, I am a real novice when it comes to DNN but I find it extremily easy to use and I am progressing in leaps and bounds.

However, I have designed numerous sites using HTML and Javascript to connect to SQL databases and display results in a table or any format required. I have tried without any success to get the Text/HTML module to display my results. Is there anyone out there that could give me a helping hand?

I dont want to download module after module to get close to what I need, I just need to enter the Javascript I have always used into the Text/HTML  Module and display the data returned in my chosen format.

All i need is a sample page/script which will connect to a give database and display the results in any format, from that script I could work out where i am going wrong.

Please contact me ASAP because this is doing my head in.

Once I have what I need, I can continue with my Extranet site.

Regards

Alex
leesykes
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3306

01 Oct 2007 2:40 PM  
Hello,

I don't know about javascript that you can insert into a text / html module to extract data out of DotNetNuke. - But, if you want to place JavaScript in a text / HTML module make sure the'source' button is selected - do not go back to HTML view and click straight on the update link, this should allow you to store JavaScript in the text HTML module.

However there are other ways of generating reports, for instance checkout the core reports module, this allows you to enter SQL queries to extract information out of the SQL database.

Or a more advanced module which will give you probably all the flexibility you need will be listx and the suite of modules from bi4ce

Hope this helps,

Thanks,

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/leesykes

Lee Sykes's Facebook Profile
ALEXw
Nuker
Nuker
Posts:19

01 Oct 2007 3:31 PM  
Lee, buddy, I'm not trying to retieve data from anything in DNN, I just need a sample Javascript scipt that will work in the Text/HTML module which will drag data from a database of my choosing and display the results in any format.


Once i see how its done I can adapt it to suit.........


Please tell me you can help, or point me in the direction of someone who can.


Regards


Alex

jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


01 Oct 2007 3:35 PM  
Alex,

I believe that Lee's suggestion of listx and possibly Xmod will satisfy your needs. You can also write custom modules to dump data into a gridview control.

Joe Craig
DNN Creative Support
Subscribe to the website
ALEXw
Nuker
Nuker
Posts:19

01 Oct 2007 4:05 PM  
No, No, No, NO please read the previous posts.....I just need a script/free module that will give me the ability to run scripts of my choosing (up to 30 different scripts on various pages) that i can use to post data to a database and retrieve the same data via a script.....

I have tried the above posts but I cannot get them to work...... Can someone please post a sample script that they have tried and tested........and works?

If I can see a working example, I can work everything else out for myself!!!!!

If DNN is as case sensitive like ASP and Javascript......then I and everyone else needs to know.

PLEASE, can anyone help????????

I absolutely love everything about this software, but if Javascript cannot be executed, I'll have to look elsewhere.

Please, can smeone help?????


Alex




jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


01 Oct 2007 4:19 PM  
Javascript can certainly be executed.

Let's focus on a single, simple script. I assume that you have a script that runs a db query and then wants to dump the results of the query somewhere. In what format is that output, and where do you want to dump it?

If you want to dump the output into a Text/Html module, then you script will need to write it's results into the entry in the DNN database that holds the text for that script. A good place to stick the javascript, hopefully, is the "header" to the Text/Html module. You can find that in the Advanced settings for the page that holds the module.

To make sure that the javascript is placed correctly, look at the page source.

Posting a simple example of the script that you want to run might help us understand.

BTW, writing a simple module to run queries against external databases and put the results in a table on a DNN page isn't that big of a deal. Even I have done that! In my case, I do it programmatically, doing the SQL scripts in c#. Your module could certainly contain a script as a parameter. If you were to decide to go that way, I'd recommend that you locate Michael Washington's blog at the dotnetnuke.com site and read over his tutorial on module development and "super simple DAL."

Joe Craig
DNN Creative Support
Subscribe to the website
ALEXw
Nuker
Nuker
Posts:19

01 Oct 2007 4:42 PM  
OK, heres a simple script that I used in previous (old) websites, I've changed the connection string and added '*****' where needed for security reasons.....dont laugh, it does actually work!!!!!!!

<%@ LANGUAGE = JScript %><%
var oConn;
var oRs;
var curDir;
var Index;
var dated;

// Create ADO Connection Component to connect
// with Extranet

oConn = Server.CreateObject("ADODB.Connection");
oConn.Open("Provider=SQLOLEDB;server=******;database=dotnetnuke;uid=*****;password=*****");



// Create ADO Recordset Component

oRs = Server.CreateObject("ADODB.Recordset");
oRs.ActiveConnection = oConn;


// Get recordset

oRs.Source = "select * from links";



// Open Recordset

oRs.Open();

var RecordCount;
RecordCount = 0;

while (!oRs.eof) { %><% for(Index=0; Index < oRs.count; Index++) { %><% }
RecordCount = RecordCount + 1; %>

<% =oRs("Title") %>

<%

oRs.MoveNext();
}
%><%
oRs.Close();
oConn.Close();
%>


Can anyone help????


Regards

Alex
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


01 Oct 2007 5:12 PM  
Is this reading from your DNN database, or an external one? If it's reading your database, why do you want to do it this way?

I guess that I can see your problem. This script doesn't know where to put the output of the query. Is that the problem?

If I were you, I'd google "dotnetnuke javascript" and I would also scan and possibly post your question at the DotNetNuke forums.

Joe Craig
DNN Creative Support
Subscribe to the website
ALEXw
Nuker
Nuker
Posts:19

01 Oct 2007 5:29 PM  

Could you recomend a way to retieve data from a DB using bespoke Javascript? as a  DNN starter/novice i'm struggling using the Text/HTML Module? All i need is a simple script that will work!!!!!

I'm from the old school and have no knowledge of XML, ASP etc I'm just fumbling around with DNN.

Can someone please post a working script that works within the Text/HTML Module?????

jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


02 Oct 2007 11:14 AM  
Check out the ReportGrid project Dnaxp.Net. It appears to answer most of the requirements that you've mentioned.

Joe Craig
DNN Creative Support
Subscribe to the website
You are not authorized to post a reply.
Forums > Users Lounge > Everything Else > Javascript and Databases



ActiveForums 3.7

Latest Forum Posts

RE: EasyCGI help? by leesykes
You may want to ask them to reset the correct permissions on your DotNetNuke installation files, som...
RE: quick question by leesykes
Hello,It will be possible to a degree, but it depends on how both of the skins have been built. You ...
RE: EasyCGI help? by Dr Joe
I'll let you know how it works out. I think I opened up about 6 tickets with them so far. ...
RE: EasyCGI help? by derpir
Hi Joe amazing to say the least! I will change host to PowerDNN as soon as possible, seems to me t...
RE: EasyCGI help? by Dr Joe
Amazing - I'm going through this exact same thing with EasyCGI! I managed to successfully instal...
Running the local host installation after building the application by saintX
My localhost installation of DNN was running blameless. After I oppened the application with VWD it ...
RE: quick question by derpir
Hello Is it possible to buy two skins and combine them? for example put one skins visual attributes...
RE: Environment Variables by leesykes
Thanks for the info,
RE: How can i edit any module from front end by sanju_k1421
ok if i added an text html . now i want to fill into that have to log in ,but i want that an...
Module not working when logged off. by t.ramya85
Hi friends,I have created two modules which interact with each other and i have kept one module to b...
RE: Environment Variables by fandnet
There are many ways to use variables like what I was trying to use...But here is how I did it.DotNet...
RE: OpenForce '08 by mgordon
It was truly a great time.  I really feel this year was much better than last year.  I hope to ge th...
Environment Variables by fandnet
I am creating a simple module that registered users can use to send an email invitation to people wh...
RE: How can i edit any module from front end by leesykes
I'm not sure that I follow, could you provide an example?
RE: Development of modules by leesykes
Hello,Glad you find them useful, at the moment there are not any plans to go into Module Development...
RE: SQL Server 2008 Documents Module DotNetNuke by leesykes
Hello,Thanks for the tip. Yes both connection strings are in correctly and the user has full permiss...
RE: Now, portal creation problem by jncraig
Since you have other issues with installing modules, etc. I believe that you are correct that it's a...
RE: How do I display the current time by jncraig
The [CURRENTDATE] skin object has a DateFormat attribute. The examples give MMMM dd, yyyy as a typi...
RE: Now, portal creation problem by SupaHoopsa
Posted By jncraig on 18 Nov 2008 8:54 AMIf there are other errors related to the database, I would s...
RE: SQL Server 2008 Documents Module DotNetNuke by MobileNow
Make sure that both of the connection strings are the same in the web.config file. Also make sure t...
DotNetNuke Modules
RSS Feeds