473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

invalid datasource problem with janus gridex

2
Hi all
I recently downloaded janus gridex for my project...
the problem is iam unable to bind data...
here is what i do ...
------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Web;
  5. using System.Web.Security;
  6. using System.Web.UI;
  7. using System.Data.SqlClient;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using Janus.Web.GridEX;
  12.  
  13. public partial class _Default : System.Web.UI.Page 
  14. {
  15.     //GridEX objgrid = new GridEX();
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         SqlConnection conn = new SqlConnection("data source =localhost;uid= sa;password= sql2005;database = janus_test");
  19.         conn.Open();
  20.         string psql = "select * from sample";
  21.         SqlDataAdapter da = new SqlDataAdapter(psql, conn);
  22.         DataSet ds = new DataSet();
  23.         da.Fill(ds);
  24.         GridEX1.DataSource = ds.Tables[0];
  25.         GridEX1.DataMember = "sample";
  26.         GridEX1.DataBind();
  27.         //objgrid.DataSource = ds.Tables[0]; //also tried by creating an object but invain
  28.         //objgrid.DataBind();        
  29.     }    
  30. }
--------------------------------------------------------------------------------
it always throws invalid datasource error
can any one help...
thanks :)
Jan 7 '08 #1
1 5416
As your probably may have considered gridEX1 donot have method of databind or something like this, your should yse set databinding and also retrieveStructure , may it be useful, keep in touch
Expand|Select|Wrap|Line Numbers
  1.             SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\7480.mdf;Integrated Security=True;User Instance=True");
  2.             conn.Open();
  3.             string psql = "select * from TGAccount";
  4.             SqlDataAdapter da = new SqlDataAdapter(psql, conn);
  5.             DataSet ds = new DataSet();
  6.             da.Fill(ds);
  7.             gridEX1.DataSource = ds.Tables[0];
  8.             gridEX1.DataMember = "TGAccount";
  9.  
  10.             gridEX1.SetDataBinding(ds.Tables[0],"");
  11.             gridEX1.RetrieveStructure();
Apr 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
0
by: Jerry | last post by:
Below is ALL the code for all the databases... Here's the problem: I callup the aspx file in IE and the form comes up just fine. When I select a person to update, I get the subject error. ...
0
by: pete | last post by:
Greetings all, I am going to attempt to describe the issue that I am having in full. I apologize ahead of time that this may be a long posting, however, I have found no other solution to my...
0
by: MeMySelf | last post by:
i have a problem when i want create Hierarchical Data..please help me to solve this problem..i would be thanks fully if you can explain step by step using this tools (Janus Web GridEX)..thnX
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
1
by: jamesmcdonagh | last post by:
Hi newbie using nAnt for .net 2.0. I would be happy of any help that you may be able to provide. The weird thing is that VS.net builds without a problem. And the intellisense within the object...
2
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
1
by: palmah11 | last post by:
Hi, I have a Windows Application in which i am using Janus GRidEx for displying data. In this Janus Grid i have a check box column. i want a functionality if user selects checkbox for particula...
0
by: Sasie7679 | last post by:
Hi, We are using Janus GridEX control(1.6e) for VB6.0. We compile our VB exe in windows 2003 server. With the latest security patch for OLE from microsoft, the exe crashes during compilation. We...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.