SEARCH YOUR SOLUTION HERE  

probs getting data in datagrid to load

hi. i am new to sql databases and am currently trying to get the
table to populate with data from the database cnCMS. I have been
following the ADO.NET step by step text but, when i compile, i keep
getting a blank page. below is the method I am using for when the
page loads. any ideas what i might be doing wrong any suggestion
much appreciated.

thanks in advance.



Code: privatevoid BindDataGrid() { string sqlQuery = "SELECT AccountID, UserName, Password, " + "Email, ModifiedDate, CreationDate FROM Account"; cnCMSNET.Open(); SqlDataAdapter daAccount = new SqlDataAdapter(sqlQuery, cnCMS); daAccount.Fill(dsMaster2, "Account"); DataGrid1.DataSource = dsMaster2.Tables["Account"].DefaultView; DataGrid1.DataBind(); cnCMSNET.Close(); }

Posted On: Tuesday 20th of November 2012 04:22:53 AM Total Views:  463
View Complete with Replies




Related Messages:

true/false data type   (229 Views)
.. i just need to know the data type that allows only true/false values so i can update it's fields with true/false value (like yes/no in access) .. i know all data types that allows strings can accept the string "true" but i need the "true" data type not the string thx
Query: datetime dataType issues   (301 Views)
Hi. I have a table with a datetime DataType. The datetime is stored like such: 11/23/2004 11:23:45 AM If I try to query my data by a specific date '11/23/2004' no records are returned. If I try to do a date range BETWEEN '11/23/2004 12:00:01 AM' AND '11/23/2004 11:59:59 PM' my webpage throws back and error.
DTS - using multiple data sources   (359 Views)
How do I use a view or query that references two different data sources ie 1 Oracle (APPPCT_PROJECT_TYPE ) and 1 table within my Sql. (ProjectTypes) I want to use a query that looks and the data in the Oracle table compares it against my current table to determine if there are differenes and if so update current table with the differences in the data. This is the query I would have used in Access: Help me to convert it use using DTS. INSERT INTO ProjectTypes ( ProjectTypeCode, ProjectTypeDescrip, ProjectCatagory, ProjectClass, CapitalProjectNum, DateCreated, UserCreated, DateModified, UserModified ) SELECT APPPCT_PROJECT_TYPE.ID, APPPCT_PROJECT_TYPE.DESCR, APPPCT_PROJECT_TYPE.PROJ_DESCR_CATEGORY, APPPCT_PROJECT_TYPE.PROJ_CLASS, APPPCT_PROJECT_TYPE.CPN, Now() AS Expr1, "import" AS Expr2, Now() AS Expr3, "import" AS Expr4 FROM APPPCT_PROJECT_TYPE LEFT JOIN ProjectTypesON APPPCT_PROJECT_TYPE.ID = ProjectTypes.ProjectTypeCode WHERE (((ProjectTypes.ProjectTypeCode) Is Null)); Any assistance in this mater is greatly appreciated. Sincerely, Karen
Error Accessing MSAccess database on network drive   (364 Views)
On a network drive accessed by all users,I have created a directory with all security permissions to . Copied the MSAccess database to this directory and granted full control to Everyone.From a personal web server on my machine , I am trying to access a MSAccess database on a network drive and get the following error.I also created a folder on my C: drive.When I change the database path/namt to clannedactivitypact.mdb everything works fine.But when I try to access the database on the network drive, I get the following errorError Type:Microsoft JET Database Engine (0x80004005)The Microsoft Jet database engine cannot open the file 'gperationssupportplannedactivitypact.mdb'. It is already opened exclusively by another user, or you need permission to view its data./html/html/Jon/jon_entry.asp, line 79Browser Type:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Page:GET /html/html/Jon/jon_entry.asp Would appreciate some help with thi
How do you create an upload on a form so that the file gets sent to the database?   (404 Views)
, I have a form written in JScript and ASP and I need to create an upload area for files of any type, ...etc. The data in the form currently gets sent to a SQL database. How does the uploaded file get to the sql database I read somewhere that the field type is "image" The other challenge is that an email gets sent to a person with a link to view the web based form with all the data. But how is this person going to view the uploaded file Ideally I'd like for them to receive the file as an attachment. Is this possible Please help! Thank you, Barnes
Script to insert 1000 rows in a database table   (235 Views)
Please guide me as to how to write a script to insert 1000 rows in a table automatically for SQL Server. the table has structure like Table1(id int,name varchar, date datetime,currency money) Thanx in advance.
Help with my connection to SQL Security database!!!   (310 Views)
I am trying to connect to the Security table to authenticate users. It works well on my box when Im logged in but it isnt working when I have another user try to connect or when I try to connect remotely. I get a SQL error on the aspx page (System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON') but I have already removed the anonymous login for IIS and I have the connection string set to SSPI (.ConnectionString = "data source=servername;initial catalog=Security;Connection TimeOut=30;integrated security=SSPI)with the web.configs identity set to impersonate=true />. Do you have any other ideas or do you know of another way I can authenticate users and get a return value
relocating datafile in sql server   (262 Views)
hi could any one please tell me how to relocate datafile in sql server TIA Anand
website triggered by a database   (206 Views)
dear everybody,i have a project about a website that is triggered by a database. it has a log-in page using SQL server. mynstructor also required that there be a "session" so that it does no goes directly to the HTML. i also would like to know about a HTML which connects to a database.i really don't know where to start.please help me ASAP
Error Openning database.   (169 Views)
everybody...My web application works fine, but when some different people try to open the databse, I get the following error...Microsoft JET Database Engine error '80004005' Cannot open database ''. It may not be a database that your application recognizes, or the file may be corrupt. /fotografia/despliegafotoeng.asp, line 310 The line of code where the error appears is when I try to open the database.The application works fine, but when I put a link to my application in a public forum (when two or more people are trying to open the database, it crashes.)I'm using Access 97 database.I have contacted with support area , and they tell me that this error happens when 2 or more people are trying to open the database at the same specific time, but the problem is that the error remains until the server is restarted.Is there any solution please help.Roberto Ayala.
Need help to export data to EXcel   (363 Views)
iam developed a module. but i want to take data backup every week related to that module. for that i want to generate one button. by clicking that button i want to import tat data in to EXCEL file. any one can help me and save me from tis problem.
App data   (224 Views)
hi,' I m fresher IN MVC Framework I have install sql server 2005 and, visual studio..2008. I m using a mvc 1.0frame work in visual studio 2008, I m trying to connect to data base.from app data,using sql server data base..templete(database.mdf),but does not connect some exception is there.. { connection to sql server files(*mdf) sql server express 2005 to function properly.please verify the installtion pf componentvor download from url//go.microsoft.com/flink/link=49251}, Ihave download express sp3.but is not working second one exception.. {Error 2 The type or namespace name 'LoginDBContext' could not be found (are you missing a using directive or an assembly reference) D:\Login\Login\Login\Controllers\LoginController.c s 12 9 Login } plz help it..
Free sqldata recovery software   (171 Views)
Hi members thanks for the good work i need help on getting a free tool for recovering sqlserver 2000 data from an mdf file . Provide me with links to it iam completely stuck please help me
ODBC connection to two databases   (213 Views)
Does anyone know if it is possible to connect to multiple databases in one connection. I have an application where i can only select one connectionstring or ODBC.
Transferring SQL Server database to host server   (228 Views)
, I have created a web site with SQL server 2005 express database using visual studio 2008 c# asp.net. I have tested the application on my local host and its all working fine. However I moved it over to the host server by simply copying all .mdf and .ldf files using ftp. I then tested it there and I get the error below: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Is there anything I was suppose to do to the database before publishing it Would be very grateful for any ideas.
Insert data into 2 tables in a single shot   (218 Views)
Hi , In SQL Server, Can we load data into two table from a single table in a single shot something like we do it as below: select * into from IS there any way to achieve this
Importing Access data to MSSQL   (180 Views)
Can someone please give me an example of how to import data in a Access Table to an existing table in MSSQL Preferably in Classic ASP or ASP.net (using .vb) Im having a heck of a time finding one.
File storage vs database storage   (141 Views)
hi, i need some advise regarding storage of data is it good to store data in files rather than storing into database (eg data like comments or additional features of products that users advertise on our website.) will it help for speed optimization.
Scheduled job not getting completed on first run(takes more than 13 hrs to complete)   (213 Views)
we are facing problem with Job performance it is taking hours to get completed : Requirement description: Requirement was to create a job which can run every week and can archive the old records (older then 365 days i.e. around 40000 Records) into an archive database and after Successful archival it deletes those from the live database. Implementation Description: I have created a scheduled job which calls "MASTER_SP" stored procedure; MASTER_SP Stored Procedure in turn calls two more stored procedures "ARCHIVE_SP" and "PURGE_SP" in a single transaction. ARCHIVE_SP Stored procedure archives the data from LIVE_DATABSE to ARCHIVE_DATABASE then PURGE_SP stored procedure Deletes that data from LIVE_DATABSE Problem Description: We took a database dump from the live environment and restored on testing environment, made changes to job and started the job for 40000 records(first run), job dint get Completed in 13 hours so I cancelled the job run. Then we tried with these tests and here are the statistics Second run 2500 records: job gets completed in 12 mins and 30 secs. Third run for 11000 records: job gets completed in 1 min and 30 secs. Fourth run 41000 records: Job gets completed in 1 min and 47 secs. Fifth run 113000: job gets completed in 4 mins and 30 secs. Sixth run 283000: job gets completed in 23 mins. We are facing the problem when job is run for first time on the restored database with huge number of records (i.e. around 40000 Records), CPU utilization is reaching to 100% on this machine, Here SQLSERVER process is utilizing CPU a lot. On the same restored database If we run the job with less number of records say 2500, then this job(i.e 2500 Records) gets completes in 12 minutes, and rest of the successive job runs(i.e. for 40000,113000, 283000) gets completed without any problem. statistics are shown above Can anyone say the exact reason why it creates problem on first run, please come up with some suggestions, so that i can implement them and move code into production.
Two seperate records getting mixed up?   (279 Views)
Can somebody please help with this problem I seem to have. I have a shopping cart that connects to the DB and adds orders as records. If two customers click on submit at the same time then both orders become one order. For example the order will consist of one customer's billing address and another customer's credit card details. Really not good stuff, how can I stop that