|
Hi,
I wanted to be sure there is no specific way to do this.
As you said, passing array make sense.
Thanks for your help.
Davy
|
|
|
|
|
Hello to all who can help:
I am interested in importing an 83 million record file into ms sql 2000 using c#.net/ado.net and export it to a xml file.
Below is the query that I tried to use to compare two tables, CLIENT and MASTER, and remove rows in CLIENT of the Phone "column" that matches the MASTER table.
Then export CLIENT out again to a xml file.
Help!
----------------------------------------------------------
sqlConnection connclient = new SqlConnection("integrated security=SSPI;" +
"data source=(local);initial catalog=Client"); private void
butDelete_Click(object sender, System.EventArgs e) { try { sqlCommand sqlDelete
= new SqlCommand("DELETE FROM Client FROM master" + "WHERE master.Phone =
Client.Phone"); connclient.Open(); if (sqlDelete.ExecuteNonQuery() > 0) {
lblMsg.Text = "Record has been sucessfully deleted!"; RefreshList();
ClearText(); } else { lblMsg.Text = "Sorry, could not access database due to
the following error: " + ex.Message; } finally { connclient.Close(); } } }
Thank You very much...
|
|
|
|
|
Hi
I have a very very simple web application that does only one thing - tries to open a connection to SQL server.
On my PC it works fine. Connection is opened immediately!
But when I put that application on my host server I get this error "General network error. Check your network documentation."!!
The code is:
private void Page_Load(object sender, System.EventArgs e)
{
this.sqlConnection1.Close();
this.sqlConnection1.ConnectionString = "Data source=myServerIPAddress;Initial Catalog=dbName;User ID=user;Password=passwd";
try
{
this.sqlConnection1.Open();
}
catch(System.Data.SqlClient.SqlException ex)
{
this.Label1.Text = ex.Message;
}
finally
{
this.sqlConnection1.Close();
}
}
Doeas anyone know why is that so?
I tried tu turn pooling off, set bigger timeout but useless!
|
|
|
|
|
I've seen a similar thing when using Names Pipes if you don't have sufficient authentication to connect to the server. Are you using names pipes? If so, try changing to TCP/IP and see if the problem goes away. If it does, then its a security issue.
Database FAQ
|
|
|
|
|
The problem was that, that my host-server and sql server wad in one domain and they use different internal ip addresses, but I was given a different sql server address so I could reac it from outside the domain.
So I got the real ip and everything works fine!
Thanx
|
|
|
|
|
We have a VB6 application that uses an Access DB. One of our customers has reported that edits to the database are not there when they go back into the record. The structure is something like:
The function is to add reciepts to a customers booking.
Edit record (create reciept record)
Commit changes (ado commit to reciept recordset)
Call routine to update log in another database (log of changes to booking including receipts)
Print Crystal report with reciept details.
Close reciept form
refresh booking form with new balance.
Everything looks OK and the reciept prints off fine (data must be in tables correctly for Crystal report to pick it up). the problem is over the past week on 4 occasions the end of day reports which list cash taken are less than the actual cash taken (reciepts are missing from the DB). I have looked at one example and although i have the printed reciept there is no evidence of it in either the main DB or the log DB. The commit has been completly reversed out.
Any ideas?
Jon
|
|
|
|
|
The Jet database engine is not capable of recovering from bad writes. If data is missing, it's usually that some kind of hardware problem has occurred: power failure, disk errors, memory errors, etc.
I would check the file server holding the MDB file very thoroughly.
As I said, Jet is not capable of recovering from these errors. In the long term I would suggest moving to MSDE (SQL Server 2000 Desktop Engine) or, when released, SQL Server 2005 Express Edition which both have these capabilities.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
It is not just that the data is missing it is that it has been removed. It was in the tables (even if it was only for about 10 seconds) but must have dissapeared quite soon after that. Would the hardware problems cause that?
Yes,MSDE or SQL server would be better (especially given that some ofour new customers are quite large organisations) and i keep pushing that we look at migrating the code, but in this case it would be a big job. The app uses a mix of DAO and ADO and a lot of dynamic SQL, the boss just keeps saying 'maybe we'll look at it in the future', ie never.
Jon
|
|
|
|
|
I've added a dropdown list to a data grid and I've populated it with Dataset values.Its working fine.But its selected index is always 1. ie., the first list element is displayed in the dropdown by default. Can anyone pls tell me how to set the selected index of dropdown listdynamically while populating the data grid based on the value that is retrieved from the database?
Thanx a lot in advance, Sandhya
|
|
|
|
|
How to tell MS Access to allow zero lenght in the strings field using the CREATE TABLE command. Thanks in advance.
|
|
|
|
|
it is not possible.
i think u want to use Char Value type for that field. if there will be a lot of zero length data in field, use varchar type. It doesnt consume your performanse. If u use Char, as if u save zero length data to field, it will reserve a n length place. (n, your charecter count as CHAR(5))
|
|
|
|
|
As far as I know MS Access doesn't have any DML DDL statements like CREATE TABLE. The closest you'll get it reading the Msys... hidden tables.
If you go into the design view of the table, you will see the various options per field.
I think Access allows zero length by default. Remember that zero length and null are different.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards "Most of us are programmers, but a few use VB", Christian Graus
|
|
|
|
|
Thanks, but I do create my tables with CREATE TABLE (OleDbCommmand.ExecuteNonQuery) and the problem is that I afterwards have to go into access and alter the settings from there.
Allowing null I have no problems with. /Robert
|
|
|
|
|
Hi,
I tried to install MSDE2000 in my PC by downloading sql2kdesksp3.exe from microsoft. after installation, when i tried to access the databases through osql tool, it is displaying the following error:
[Shared Memory]SQL Server does not exist or access denied.
[Shared Memory]ConnectionOpen (Connect()).
when i checked in AdministrativeTools-> Services, i could see MSSQL$Myinstance running. even i re-started that service, there is no use.
Can anybody please help
|
|
|
|
|
Use your machine name inplace of localhost while using osql commands
|
|
|
|
|
By default MSDE with SP3 allows only Windows authentication and does not enable any network protocols. The shared memory protocol should work.
To re-enable network protocols, use the Server Network Configuration utility.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello there,
With an array list containing structures that I want to insert into the database, I attempted to use BULK INSERT in insert all the data at once (this is faster than a loop of INSERTs right?).
However, can I do a BULK INSERT without first writing the data into a file?
Thanks,
Rafferty
|
|
|
|
|
Hm.. no one's replying.. does this mean that there's no other way to do this?
maybe there's another command (other than BULK INSERT) that can accomplish such a task.
|
|
|
|
|
Hello All,
I am implementing merge replication over internet, having following scenario
.
Publisher has some 14 tables in the database out of which only 7 are to be p
ublished, because only 7 tables are having information which will be changed
hence no need to publish.
At the subscriber side also there will be 14tables and out which 7(published
by publisher) will be receive updates from the publisher vis synchronizatio
n.
Now come to the problem:-
When I am trying to apply initial snapshot its it trying to drop existing ta
bles (which I don't want), since table contain froeign key constraint(I came
to know this by seeing output file of merge agent) and because of master-de
tail relation it is not able to drop it and giving error.
I don't want dropping and recreation of the tables in the databse as I am ha
ving correct schema at the subscriber side can anyone help me???
RuchirDhar Dwivedi
Software Engineer
Windowmaker Software Pvt.Ltd.
Baroda, India.
|
|
|
|
|
In my application, I create new databases and tables in the MSDE server. After inserting all the records into the tables I want the user to be able to view the data in Access. This I would like to automate instead of having the user open up access and doing the import themselves. Is this possible? And how is that done?
Now what is the best way to import the data? By creating an access project (.adp) or a database (.mdb)? I would like the user to be able to copy the file to a disk and view it on another machine. The problem with creating an Access project is the user will still be able to edit the data. Based on Windows NT Authentication, the user did have the right to write the extracted data in the application to the MSDE server. But after that’s done with, I don’t want them to edit the data. And if project was used, would I still be able to transport the files to be viewed on another machine or it needs to be exported to mdb?
If exporting to mdb, wouldn’t that complicate the automation of the database creation because a DSN must first be created?
Any help would be much appreciated!
|
|
|
|
|
Instead of duplicating the work of creating data in MS Access, why dont you create a small VB application or a macro in EXCEL (just for displaying data). because you dont want the users to edit the data.
|
|
|
|
|
My program is written in Visual C++. I want the users to be able to do complex queries and generate reports. That's why I chose to display it in Access. I guess I can't avoid having the data read-only because it has to be manipulated. How do I proceed with this?
|
|
|
|
|
I did this before, but it was used to copy a few smaller tables into Access instead of very large ones, as you plan to do. I would crete a linked table to the MSDE in Access and then used two queries in Access. The first was a Delete query to remove the data from the table in Access and then an Append query to fill the table with the data from MSDE. I combined the two queries in a Macro (although you could code it as well) and ran the query in the OnLoad event of my Main Form.
The DSN was not an issue, as it was created with the original front end Access.mdb and when I sent out copies of the mdb, the DSN remained with the mdb file. I did not have to create DSNs on other computers.
Not sure if this helps or not.
Marc
|
|
|
|
|
I am going through so old code adding in error checking and i came across this statement
SQL = "SELECT RouteDef.RouteID, RouteDef.StepID, RouteDef.DeviceID, RouteDef.ReqPos INTO " + sTempTable + " FROM RouteDef WHERE (((RouteDef.RouteID)=" + IntToStr(iOldRouteNum) + "));";
The comment before the statement said something about creating a temporary table.
My question is will this SELECT statement work on a SQL Server 200 machine?
-----------------------
Ok now what?
-----------------------
Never mind i found my answer.
Thanks
|
|
|
|
|
I can update regular column with varchar/numeric type, but I when I try to update image data(longblob) in MySQL, but it doesn't work. Can anybody help me on how to do that?
Here is my code for this:
ProducerConn->Open();
ProducerSide->CommandText = "DROP TABLE IF EXISTS MyDB";
ProducerSide->ExecuteNonQuery();
ProducerSide->CommandText = "CREATE TABLE MyDB (ID timestamp(14), ext varchar(5), image longblob)";
ProducerSide->ExecuteNonQuery();
String * FILE = "image.jpg";
FileStream * tfs = new FileStream(FILE, FileMode::Open, FileAccess::Read);
Int16 len = (int)tfs->Length;
Byte buffer[] = new Byte[len];
tfs->Read(buffer, 0, buffer->Length);
// ProducerSide->CommandText = "update MyDB set image=buffer"; <---- line with problem
ProducerSide->CommandText = "UPDATE MyDB set ext='jpg'";
ProducerSide->ExecuteNonQuery();
Thanks!
|
|
|
|