|
Create a BLOB in the database and store it in there.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
how to delete duplicate rows in a table if that tables has no primary key
|
|
|
|
|
The quickest method is to add a primary key to that table. You can always remove it after you've deduped the table.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi,
i m newbie for Sql server.presently i m developing application in vb.net
can anybody tell me what is the exact connection string to connect sql server which is located remotely .
Related information is following:
Server Side:
SQL server 2000
IP address- xx.xx.xx.xx
Database Name-MyDatabase
UserName-Myuser
Password-MyPassword
Client Side
XP SP2
VB.NET
SQL Express Edition 2005
SQL Native Client
Thanks
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
I dont know this if will help you but try this this is the Common one
"Data Source=ipaddress;Initial Catalog=db;User Id=username;Password=apassword;"
Is the server on the same Lan as you are?
tell me if it helped
Vuyiswa
|
|
|
|
|
actually server is located remotely (mean on the internet).
i already use connectionstring provided by you.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
From the Connection string i gave you. Apply the IP Address of the Server, it will work, as Sitting here am accessing the SQL Database and i used VB.net to my Application to a SQl Server not in my building, its Far in another City. try it and tell me the Errors that you encounter
Dont bother where ever the server may reside in your connection string you just change datasource(server) field
datasource=IP of the server if you are using internet
or
datasource=server name iof you are using local server
connection never changes but make sure that user id and password are correct
Vuyiswa
|
|
|
|
|
hi Vuyiswa,
i already try datasource as u specify. it work well for local server but not for remote server.
i get following error
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
i don't know where i m wrong ?
is this related to proxy ?
thanks
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Rupesh
Your code is Correct there are two or more reason why you Got that Error
Its Eather you Dont have the Correct Credentials to Log in meaning username and password, or you have no permission to the database or table you want to Access. or You hae supplied the Wrong server, or your Server is Down. please send me the code that you wrote and let me see your connection string.
Vuyiswa
|
|
|
|
|
Vuyiswa,
this is the code
Dim SqlConn As String
Dim con As SqlConnection
SqlConn = " Data source=64.78.15.54; Initial catalog =counterbar1; uid=havenbar; pwd=bar91384;"
con = New SqlConnection(SqlConn)
con.Open()
If con.State = ConnectionState.Open Then
MsgBox("connected")
End If
try this code and tell where i m wrong
Thanks
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
The Code is Correct, make sure you are using the correct IP for the SQL Server,you might find out that, you have been provided with the wrong IP for SQL Server, Make sure the username:havenbar have right to Access the Database you want to counterbar1. But all the rest is Correct.
Vuyiswa
|
|
|
|
|
Vuyiswa,
i m sure IP address is correct. But i will again confirm it with client
Thanks for ur support.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Welcome,let me ask you. is the SQL server at your client a Dedicated or non Dedicated? , if its non Dedicated he might have gave you the wrong IP,
Vuyiswa
|
|
|
|
|
hi Vuyiswa
first of all,sorry for delay.
i m not sure about this point,but i will confirm.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Its Ok Take your time, am here Day and night learning and teaching
Vuyiswa
|
|
|
|
|
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
oSQLConn.ConnectionString = _
"Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword"
oSQLConn.Open()
add the port number of the SQL server
Vuyiswa
|
|
|
|
|
hi Vuyiswa,
i have already tried for this port number. But no suceess.
Presently confirmation about IP address is still pending
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Have you ever resolved this? If not then I have to ask.....can you telnet to the SQL server from the internet? Also is the router forwarding all packets on 1433 to the SQL server or is this server on the internet with no router at all?
Tom Wright
tawright915@gmail.com
|
|
|
|
|
hi tom,
i resolved this problem . there r small problem at client side.There r no problem in my connection string. Now my connection string work well
thanks for your support
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
how can display a table (in .mdb file) by datagrid
|
|
|
|
|
create a Dataset and populate it with your table data....now assign the Dataset as the DataSource of the Datagrid in which you want to display data...
Tirtha
Miles to go before I sleep
|
|
|
|
|
my purpose is to copy selected records in a list control into a table in .mdb file;
but st is wrong
void CReadDBDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CDaoDatabase db;
CDaoTableDef tableDef(&db);
db.Open("C:\\ktt.mdb");
db.Open("C:\\ktt.mdb");
CString strSQL;
CString str0;
CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_ListControl);
ASSERT(pListCtrl != NULL);
POSITION pos = pListCtrl->GetFirstSelectedItemPosition();
if (pos == NULL)
TRACE0("No items were selected!\n");
else
{
while (pos)
{
int nItem = pListCtrl->GetNextSelectedItem(pos);
TRACE1("Item %d was selected!\n", nItem);
// you could do your own processing on nItem here
str0 = pListCtrl->GetItemText(nItem,0);
strSQL.Format("INSERT INTO Table6 IN 'D:\\copyktt.mdb' SELECT * FROM Table3 WHERE MyField = %s ",str0);
db.Execute(strSQL);
}
}
}
|
|
|
|
|
So there's this guy I know and he wants me to teach him data modeling in a nutshell. He asked me to just give him a fast run-down on Primary Keys, Foreign Keys (the difference) and normalization. He's pretty smart so a link to something brief but technical is fine.
...
...
Okay! I'm lying! The guy is me and I haven't done data modeling in years. I'm trying to remember this simple thing. If I have a table called Sequences as an example and I have a table called OrderProcessing and 6 other tables that use Sequences.SequenceId (or a number representing that number in the Sequences table). Do I just make all of them FK's to the Sequences.SequenceId PK?
Does that make sense? I totally need a drug test and I know that...
My name is Maximus Decimus Meridius, Commander of the Armies of the North, General of the Felix Legions, loyal servant to the true emperor, Marcus Aurelius. Father to a murdered process, husband to a murdered thread. And I will have my affinity, in this life or the next. - Gladiator. (Okay, not quite Gladiator but close.)
I work to live. I do not live to work. My clients do not seem capable of grasping this fact.
Ancient of days! august Athena! where, Where are thy men of might? - Lord Byron
|
|
|
|
|