.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Android Creating and connecting to a database

Posted By: Syed Shakeer Hussain     Posted Date: March 30, 2011    Points: 2   Category :Others
What is SQLite
SQLite is an open-source server-less database engine. SQLite supports transacations and has no configuration required. SQLite adds powerful data storage to mobile and embedded apps without a large footprint.

Creating and connecting to a database
First import android.databse.sqlite.SQLiteDatabase into your application. Then use the openOrCreateDatabase() method to create or connect to a database. Create a new project in Eclipse called TestingData and select the API version of your choice. Use the package name higherpass.TestingData with an activity TestingData

View Complete Post

More Related Resource Links

Connecting to MS SQL Server database using webmatrix.



I am novice  user to raizor syntax using webmatrix and i am trying to connect MS Sql server database (instead of using .sdf file i am using .mdf file) using the tool webmatrix for startersite.

The connection string that i setup as follows.

<?xml version="1.0"?>


        <compilation debug="false" targetFramework="4.0" />
    <add name="OESConnectionString" connectionString="Data Source=.\SQLServer2005;AttachDbFilename=|DataDirectory|\OES_Data.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />


And i am using websecurity helper as well and the setup is as follows.

WebSecurity.InitializeDatabaseConnection("Data Source=INLTE5556\\SQLServer2005;Initial Catalog=OES;Integrated Security=True", "System.Data.SqlClient", "UserProfile", "UserId", "Email", true);

When i am trying to insert the user details into database i am getting the below error.

Format of t

Create user is creating aspxxxx.mdf database in my app_data folder


I had already setup roles for my pages and requirements call for ability to manage and create users.

So i was looking at code that allows you to do so using membership, even though i got the page to work, it was creating a database in my app_data folder.. i already have SQLExpress setup with the asp schema, but cant figure out how to get my application to use that instead of creating the db in the folder?

What am i missing or doing wrong?

I have the following setup in my web.config file..

		<authentication mode="Windows"/>
			<deny users="?"/>
        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Creating an database search application in VS C#

Hello everyone, I wish to create a C# application that will have a form and a text box where I can enter a text, and then ask the application to search if this text exists in a database. If it exists, I want all the information associated with this text to be displayed in a datagrid view or list box. I am able to create a database in SQL Server and I can connect to my database from VS 2005 C#. If this is possible, how do I go about it? Many thanks in advance.

Creating database throw exception!

When running SQL commands, it throws error information. Why is it? My env :    windows server 2003 64bit     sql server 2008 . Command :   CREATE DATABASE [AdventureWorks2009]     ON (NAME = 'AdventureWorks2009_Data', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2009_Data.mdf', SIZE = 170, FILEGROWTH = 8),     FILEGROUP DocumentFileStreamGroup CONTAINS FILESTREAM ( NAME = FileStreamDocuments, FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents')     LOG ON (NAME = 'AdventureWorks2009_Log', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2009_Log.ldf' , SIZE = 2, FILEGROWTH = 96); GO     Error information:   Msg 5120, Level 16, State 106, Line 1 Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Documents". perating system error -2147024891: "0x80070005(failed to retrieve text for this error. Reason: 1815)".

Cannot see top link bar when creating a Web Database site

Hi, I am new to Sharepoint 2010 and am very keen to start using the new Web Database site templates such as Asset Web Database and Issue Web Database. I am able to create these without issue however once i build and navigate to these sites i lose the top link navigation bar. For other sites such as Team Site this is not problem and the navigation site remains. Does anyone have any suggestions on how to show this navigation bar for these site templates?

Error connecting to Remote report server database in SQL Server 2008 R2 DataCenter Edition

I am trying to configure my report server installed on Server A to point to a reporting services DB on Server B. I am able provide the name and test the connection. However, when i click next on the configuration wizard after providing the Server A name I am receiving the below error: The feature: "Remote access to report data sources and/or the report server database" is not supported in this edition of Reporting Services I have SQL Server 2008 R2 DataCenter Edition on both the servers.    

Error in attaching database file and creating a new connection

I am having problem when i was trying to attach .mdf file while create a new connection of SQL server, create a new connection of SQL database file and open the database in Server Explorer. I am using VS 2010 Ultimate and SQL Express 2008 R2.Can anyone please tell me what is the problem I am facing?Here are the error message.1. Attach .mdf in SQL database file and open the database in Server Explorer2. Create a new SQL server and attach .mdf

Trouble Connecting to a Database

I downloaded a sample DB from here: http://msftdbprodsamples.codeplex.com/releases/view/4004   Specifically, this is the ‘ AdventureWorksLT.msi ’ So, I loaded it into my SSMSE, right-click Databases > Attach > Database > Attach > etc., etc.   Now, in C# (Express) I goto Add new Datasource > Database > Next > New Connection > Browse . . . navigate to the folder that holds the AdventureWorksLT.mdf Select it and click Open and then I get this message: AdventureWorksLT_Data You don’t have permission to open this file Contact the file owner or an administrator to obtain permission.   I don’t think I’ve ever seen this message before, and I am the administrator.  What am I doing wrong here?  Also, what so I need to do to get this working? Thanks! Ryan---

connecting managementstudio to hosted webserved sql database

in the wizard connecting to a server in the sql server management studio jou have to fil the server name in all the video`s from microsoft are (local) what should i write in this wizzard when i have my database standing by a provider?   

Creating Database gives error : "Directory lookup for the file "xxxxx.mdf" failed with the operating

Hello FriendsI am creating Database using SQLDMOcode is as follows... Code Snippet SQLServer2Class server = new SQLServer2Class();server.EnableBcp = true;server.Connect(WebConfigurationManager.AppSettings["ServerName"] ,WebConfigurationManager.AppSettings["UserName"],WebConfigurationManager.AppSettings["Password"]);DBFileClass dbFile = new DBFileClass();           dbFile.Name = dbName;          dbFile.PhysicalName = "C:\\" + dbName + ".mdf";          dbFile.Size = 300;          dbFile.FileGrowthType = SQLDMO_GROWTH_TYPE.SQLDMOGrowth_MB;          dbFile.FileGrowth = 25;          dbFile.PrimaryFile = true;          LogFile2Class dbLogFile = new LogFile2Class();          dbLogFile.Name = dbName + "_log";          dbLogFile.PhysicalName = "C:\\" + dbName + "_log.ldf";          dbLogFile.FileGrowthType = SQLDMO_GROWTH_TYPE.SQLDMOGrowth_Percent;          dbLogFile.FileGrowth = 10;          Database2Class newDb = new Database2Class();          newDb.Name = dbName;          newDb.FileGroups.Item("PRIMARY").DBFiles.Add((DBFile)dbFile);          newDb.TransactionLog.LogFiles.Add((_LogFile)dbLogFile);          server.Databases.Add((_Database)newDb); This Code Generates Following Error !!]Microsoft][ODBC SQL Server Driver][SQL Server]Directory lookup for the file "D:\Projects\my_system\mySys

Creating table with database data, ASP.net and C#

Hi!I just started with my first ASP.net page with C# and I want to create a dynamic table with information from my database. I have connected to the database to the page with datareader, so that is solved. The problem is making the table and import the data into the different rows and columns. I also want the possibility to edit and remove this information from the table. Its supposed to be a table with information about customers.I have no idea whats the best solution for this and I hope you guys got information or links that show how to do this?Regards,fh01

how to attach sql database file to creating .exe setup in c#

I create a Setup file and put data folder, in data folder i put database file , but the problem is i have to mannualy attach database file in sql server 2005. I have to automatically attach database file when installing setup file.

Error while connecting to Database Engine within SSMS 2008

Error text is as below:- any suggestions ?   ===================================   Cannot connect to TEJ-PC.   ===================================   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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476   ------------------------------ Error Number: 2 Severity: 20 State: 0     ------------------------------ Program Location:      at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)    at System.Data.SqlClient.SqlInternalC

Need to restore MDF or LDF file from BAK without creating database.

I need to restore the actual MDF or LDF files within a BAK file without creating/restoring to another database. I just need the physical MDF or LDF files only. Is there a way to do this?
What is not explicitly allowed should be implicitly denied

SQL Server 2008: When creating database with filestream group pc hangs


I am facing this STRANGE problem with sql server 2008. When I try to create a new database with filestream group my system hangs. When I restart pc by direct power off and then on, I cannot see the new database but at the given location I could see that database files and filestream group has been created. 

Solutions Tried.
Uninstall, download new version then reinstall but to no use.
Set maximum permissions to current user (according to my knowledge).
Using Mix mode authentication.

PC configuraion:
XP Home Edition SP2,
Intel Dual Core 2.0 GHZ Processor
4GB Ram,
SQL Server express SP1 installed on NTFS Partition
Plenty of Disk Space
Comodo Firewall pro, Avast Antivirus ( Already tried to stop firewall and antivirus still no use)

Any help would be appreciated.

Creating a SQL Express database


The goal is to treat databases like documents:  When the user creates a new 'document', the application programmically creates.  Currently the databse being used is SQLite, we are looking at SQL Express as an option, but we must overcome this hertial first:

Q: Are there any good examples of creating a empty SQL Express database programmatically? 


Problems Connecting Excel Services to Oracle Database


I am just beginning to experiment with using Excel Services with BI Dashboards in SharePoint 2010.  I created a Excel Workbook that has a data connection using connection type of OLE DB Query with a connection string of "Provider=MSDAORA.1;User ID=<username>;Data Source=<oracleEnvironment>".  I have the Excel Services Authentication Settings set up for a specific SSS ID <mySSSID>.


This Excel Workbook has been Saved to SharePoint with an entire sheet published.  The Excel Web App is displaying the sheet and the Slicers are functioning just like they do in the Excel client.  When I refresh the data on the client I get prompted for a password and it works fine.  When I refresh on the Web App I have received a variety of errors depending on what I try but nothing has helped me track down what I have missed.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend