Hi, I have a datatable matching the structure of a MS Sql table and I would like to import new records from the datatable into SQL.
So, in the example below, I am looking to import the record for Jim.
DataTable:
Name DOB Country
Brian 11-11-78 USA
Dave 01-01-80 UK
Jim 02-02-81 FR
SQL:
Name DOB Country...
Hi,
I am working on a application which I want to expose to external world using ODATA. Let me first give you idea of that application.
In that application I need to create a library that will allow the users to perform CRUD operations on the database. For this client has provided XSD , from which we need to generate the classes. Using...
I find this whole GetSchema thing awfully complex. Is there any decent documentation for all this at all? One would expect that normal use is to get data for table: indexes and columns(name, type, allownulls) and then have method(s) to ask these properties. One might also expect that these properties would be enum or even a webpage that ...
Hi,
I have a sqldatareader populated with this command:
string cmdlookup = String.Format("Select {0} from {1}", strSourceName, strSourceTable);
SqlCommand sqlcom = new SqlCommand(cmdlookup, con);
SqlDataReader rdrsource = cmd.ExecuteReader();
while (rdrsource.Read())
{
this.lstSourceValues....
In SQL Server, ID is a not null integer, and an identity.
When I run the following code, I get an InvalidCastException on the last line:
SqlCommand cmd = new SqlCommand();
cmd.Connection = _conn;
cmd.CommandText = @"INSERT INTO [Users] (Name, Email, Password) VALUES (@name, @email, @pass); SELECT SCOPE_IDENTITY()";
cmd.Parameters.Add...
code :
SqlConnection sqlc = new SqlConnection(
"Data Source=" + Environment.MachineName + @"\SQLEXPRESS;" +
"Integrated security=true;" +
"database=someDB");
SqlCommand sqlcmd;
string tmp = string.Empty;
for(int i = 0; i < 100000; i++)
{
tmp += "inserto into [...
I am working on custom data provider using ADO .NET Entity Framework.
In the CreateMetaData function, I need to add primitive and complex properties in the ResourceType.
I believe Enum should be added as the complex data type.
If yes, how can I add this? Any pointer would be a great help.
Thanks,
Ram
...
Hello,
I have a lot of excel sheets which columns are slightly different, i want to import all of these sheets (one at a time) into ONE SQL TABLE. I'll give an example :
Say ive written the required program and called it Excel2sql converter. So Excel2sql takes an excel sheet and create a database table with the data of that excel shee...
Hi
I read a lot articles about how to work with database in WPF .Net 4 application. As I understood, the main two technologies are:
Linq to SQL (L2S)
Entity Framework (EF)
but sometimes I also can see mention of Linq to Entities (L2E) technology, but can't find clear explanation what difference between EF and L2E.
So, my question i...
I've got an Oracle 10g database which is accessed from an ASP.NET application. Although I've used SQL Server heavily in many different aspects and Oracle for querying and reporting, this is my first time using Oracle as the OLTP database for an application.
The database-level procedures in the packages are typically of the form:
-- TY...
I'm trying to make a simple form that contains textboxes that draw from a db in my project. I'm using the table adapter's GetData() method in the xsd file to populate the data context. I want to update one of these textboxes and have the changes reflected in the database. The textboxes populate fine, but the changes don't make it back to...
For a particular installation of my application, I need to create the database and the schema on the SQL server from the installer itself. I have a custom installer through which I have been able to detect and install the pre-requisites and the software. The user is prompted to give the IP of the database server and the username and pass...
SqlDataReader reader;
string r="";
if ((FileUpload1.PostedFile != null)&&(FileUpload1.PostedFile.ContentLength > 0))
{
r = System.IO.Path.GetFullPath(FileUpload1.PostedFile.FileName);
}
OleDbConnection oconn =
new OleDbConnection
(@"Provider=Microsoft.Jet.OLEDB.4.0;"
+ @"Data Source="+r+";"
+ @"Extended Properties=""E...
Hello, I am new to .NET and have heard about several different ways of querying a SQL Server databse such as ADO.NET and the entity framework.
Can anyone give me some advise about the best way to go for new applications?
Thanks for any help or suggestions.
...
I'm converting some RDO code to ODBC Provider code in .NET.
The problem is parameter names were not specified in the orignal code, but param values were retrieved by parameter name after the command was executed.
Is there anyway to have parameter names populated by the provider once the command is executed so calling code can access pa...
I need to work in .net 2.0. So I can't use OpenXML.
This is my source code and I have already Installed AccessDatabaseEngine.exe.
But still getting the exception: "Could not find installable ISAM".
I have also tried "Extended Properties=Excel 8.0" in the connection string.
static void Main(string[] args)
{
DataSet dataSet = new D...
Hello
I wonder what's the difference between standard EF objects, POCO and Self Tracking Entities. I was looking the web but couldn't find a valuable introduction.
Any help would be appreciated.
...
I have an SQL table called tbl, im trying to add the columns A, B and C to it.
When i execute the command :
String addcolumns = "ALTER TABLE SqlCreatedTbl ADD A char(50) ;";
......
cmd = new SqlCommand(addcolumns, conn);
conn.Open();
cmd.ExecuteNonQuery();
The column i...
I wonder, what is the reason to have this SqlCommand constructor overload:
public SqlCommand(
string cmdText,
SqlConnection connection,
SqlTransaction transaction
)
?
When I need to create an internal method that does its bit using a transaction provided as an argument, I always find it sufficient to only pass an SqlTrans...
I am working on windows application using c# and MySQL.
I inserted new record by reading text file into MySQL database, Database having no primary key but combination of four columns we can consider as component of primary key (but actually database having no primary key).
I know how to add and update record using DataAdapter and DataSet...