I am writing a program in VB.Net to manage text messages sent through an API. It allows you to view messages in a datagridview and filter by date, sent/unsent etc...
To load the messages I'm executing an SQL statement and retrieving a DataTable which then gets set as the DataSource for my DataGridView control.
The problem is that depen...
I was really drawn in and fascinated by the DataRelation object for use in an ADO.NET DataSet to cache data from my database in an ASP.NET web application. Unfortunately, I realized quite late, that I really have three DataTables.
Users with a PK of UserID
Groups with a PK of GroupID
UsersInGroups a linking table with UserID and Group...
I'm working on populating a combobox in visual studio 2005 using vb and I'm stuck on the connection string part. I should mention i'm connecting to a SQL Server 2005 instance. Here is what i have:
Dim gDBA As ADODB.Connection
Dim records As ADODB.Recordset
gDBA = New ADODB.Connection
gDBA.Open("Server=e-13;Database=subscribers;User...
Hello!
SQL Server 2008
Using all the correct references I dare say:
System.Data.SqlClient;
Microsoft.SqlServer.Management.Smo;
Microsoft.SqlServer.Management.Common;
Microsoft.SqlServer.Management.Sdk.Sfc;
All compiles with no errors.
I have stripped code down to almost zero for easy debugging.
Connecting to server alright and so o...
Hi everyone,
I'm having a little trouble with my Entity add functionality.
Setup
For simplicity, I have in DB with 4 tables, Customer, Address, Area, Location.
Customer stores basic customer details ie. Id, Name, Username, Password, etc.
Address stores street name, street number, etc.
Area stores area name and area code.
Location st...
I installed the beta 2 of Visual Studio 2010 today. I went to test out the new entity framework stuff (to see if my "issues" from v1 were fixed.).
I started adding a new connection string, but when i put in my information for sql 2000 it said "this server version is not supported. you must have Microsoft sql server 2005 or later.". Did...
I'm using visual studio 2005 to develop a form with a combobox passing a value into the parameter of an embedded crystal report. I'm trying to figure out why it keeps prompting me for a database login every single time you try to run the report with a different combobox selection.
Here is my code:
private Sub Form1_load...
...
We have a SQL utility class that takes the name of a stored procedure an its input parameters, and returns the results in datatable. The reasoning behind this is so that we don't have to worry about forgetting to close connections and having connection leaks. Also so that we can reduce code by not having to recreate datadapters and dat...
Hello folks, i'm working in an app that was originally built to connect to SQL Server by using ADO.NET SqlClientProvider. Recently, i had to generalize the data provider code to work with either SQL Server or Oracle (by using DbClasses instead of SqlClasses and so on...).
My problem is: Oracle SPs need to use ref cursors to retrieve ta...
From API
In a typical multiple-tier implementation, the steps for creating and refreshing a DataSet, and in turn, updating the original data are to:
Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter.
Change the data in individual DataTable objects by adding, updating, or deleting DataRow objec...
Hello,
In ADO.net EF, when should you call the context.Attach() and the context.Detach() methods and how do these calls affect the data being returned or being inserted?
...
Hello everyone,
I am using VSTS 2008 + C# + ADO.Net + SQL Server 2008. When connecting from another remote machine, normally TCP/IP protocol is used by ADO.Net client to connect to SQL Server 2008. When connecting locally (ADO.Net client and SQL Server on the same machine), normally shared memory or named pipe is used.
My question is, ...
Hi Stackoverflow,
I am executing a simple query against SQL Server 2005:
protected static void InitConnection(IDbCommand cmd) {
cmd.CommandText = "set transaction isolation level read uncommitted ";
cmd.ExecuteNonQuery();
}
Whenever I profile with dotTrace 3.1, it claims that SNIReadSync method is taki...
I have a solution with 3 projects.One of UI (contains web pages) and one for BL and one for DataAccess layer.Now i want to access one values stored in application variable in one class inside my DataAccess layer project.How can i access application variables there ?
...
Hi,
I have MSSQLServer 2005 installed on my machine. I am creating a connection string like this:
String sqlConnectionString=
user id=admin;
password=admin;
server=MachineName\MSSQLSERVER;
Trusted_Connection=no;
database=MYDataBase;
connection timeout=30
When I do:
myConnection = new SqlConnection(sqlConnectionString);
myConnection.O...
Hi,
I am getting this "cannot open user default database. login failed" error. What I did was using ORM to create DataContext, in the code first call TableExists function to check if the version_tbl existed, if not, then call scripts to exec sql commands to create version_tbl. Then create a new dataContext, but problem is after the ca...
Hi,
Recently I've been tasked with creating an automated ETL process that pumps the data into tables based on the flat file name by reading a master mapping file. I've decided to go with SqlBulkCopy and everything seemed to be fine. IDataReader interface was implemented to read flat-files, SQL Server's meta-data provided with number of ...
Hello,
I've been wondering for some time if there is any way in Entity Framework to save some changes to the database and others not. Imagine a situation in which I have let's say 4 entity classes - Customer, Task, SalesSchema and Address. Each of those is a customers one-to-many relationship. Now I create a window with 3 tabs (using Tab...
Hello everyone,
I am using VSTS 2008 + C# + .Net 3.5 + ADO.Net + ASP.Net + SQL Server 2008 Enterprise + IIS 7.0. I want to save my time to write an simple ASP.Net web site. And want to see if I can find an available one here. :-)
What I need is very simple, (1) basic UI (2) could edit/update/delete data from database (any kinds of data...
I've been brushing up on my knowledge this evening, trying to overcome 4 years of bad programming practices because of the company I was working for. One of the things I've recently stumbled on was System.Transactions. After reading about them for the last few hours, I think I have an adequate understanding of how they work and why you w...