|
Can I have your email pls ?
|
|
|
|
|
DooDooo wrote: Can I have your email pls ?
No, you may not have my email.
|
|
|
|
|
Hi Everyone!
I'm trying to create a new database file from XSD schema and then populate the empty SQL database with a DataSet. The major problem is to create a table from XSD schema file. I'm using SQL Server 2005 Compact Edition and VS 2005.
File.Delete("Test.sdf");
string connString = "Data Source='Test.sdf'; LCID=1033; Password=\"s$;2'!dS64\"; Encrypt = TRUE;";
SqlCeEngine engine = new SqlCeEngine(connString);
engine.CreateDatabase();
engine.Dispose();
SqlCeConnection conn = new SqlCeConnection(connString);
conn.Open();
DataSet dbSet = new DataSet("myDataSet");
dbSet.ReadXmlSchema("myData.xsd");
dbSet.EnforceConstraints = false;
dbSet.ReadXml("myData.xml");
...
conn.Close();
Any help would be greatly appreciated.
Gywox
-- modified at 10:34 Thursday 29th March, 2007
|
|
|
|
|
i have 2 computers. first its name is PC1 with ip 192.168.0.1 and the other PC2 192.168.0.75
PC1 has the SQL database and PC2 should access the database
i do not know how to make PC2 access the Database in PC1...
need help on that please
thanks allot
|
|
|
|
|
This answer assumes you are using SQL Server:
The connection string will refer to the name PC2, or you can use its IP address. You must also permit the SQL Server to accept network connections.
|
|
|
|
|
i really need more details...
the .mdf file on PC1 "C:\DB.mdf" ... what should the connection string used on PC2?
and how can i permit the SQL Server to accept network connections.
|
|
|
|
|
marwan_siala wrote: the .mdf file on PC1 "C:\DB.mdf" ... what should the connection string used on PC2?
SQL Server is not a file based database system. It is a server based database system. You cannot connect to files (SQL Server 2005 does give you an illusion that you can, but it temporarily connects the file to the server)
In short: You connect to a server, not a file.
marwan_siala wrote: and how can i permit the SQL Server to accept network connections
I really need more details... For example, the version of SQL Server.
|
|
|
|
|
from SQL Server Configuration Manager ( Version: 2005.090.3042.00 )
i dont know if thats the version you asked..
about the connection what should i do to make PC1 and PC2 access the same file
|
|
|
|
|
marwan_siala wrote: about the connection what should i do to make PC1 and PC2 access the same file
You don't you get the sever local to the file access it and then connect to the server. As I already told you: SQL Server is a server based database, not a file based database. You connect to the server.
First, to allow network access:
Go into SQL Server Configuration Manager. Open "SQL Native Client Configuration"-->"Client Protocols" and ensure that "TCP/IP" is enabled.
Then open "SQL Server 2005 Network Configuration"-->"Protocols for <instance name>" and ensure that "TCP/IP" is enabled.
Then go into "Microsoft SQL Server Management Studio" and connect to the relevant server. Once connected, open up the databases. If the database is not there, then right-click on "Databases" and attach the file that you want.
Then in your application you connect as normal, specifying the name of the machine that is running the SQL Server.
|
|
|
|
|
i don't know where "Microsoft SQL Server Management Studio" is? i could not find it??
|
|
|
|
|
marwan_siala wrote: i don't know where "Microsoft SQL Server Management Studio" is? i could not find it??
because i was using the express edition ... now i have SQL server 2005
but when i need to access the database in PC1 and PC2 a message apear telling me that "the default settings SQL server doesn't allow remote connections"
what shuld i do?
thanks
|
|
|
|
|
I written strored procedure as below
create procedure testProc
@param varchar(100)
as
select * from authors
where au_id in (@param)
when i, execute this with following parameters, it gives me error. I execute it like this..
exec testProc('''2104206'',''123''')
Regards
PVC
|
|
|
|
|
parasu_516 wrote: exec testProc('''2104206'',''123''')
Change this to exec testProc('2104206','123')
How can you pass two values to procedure when the procedure accepts only one ?
http://w3hearts.com/articles/6/[^]
|
|
|
|
|
Actually you need to change it to be
exec testProc('2104206,123')
If you look at what the SP is trying to do he wants to be able to pass in a range of values and return those details which are in the LIST of items as a single parametr.
Now I'm not even going to get started on WHY this is dangerous for security - but this will make it work......
Mark.
|
|
|
|
|
|
Hi,
If we create a stored procedure where and how is it saved and how is error handling done to the procedure. If any error occours where is it thrown. Help me.
Thanx,
Yamini.
|
|
|
|
|
yaminilatha wrote: where and how is it saved
Inside your database.
yaminilatha wrote: how is error handling done to the procedure
You can do error handing inside the proc by checking the @@error value.
yaminilatha wrote: If any error occours where is it thrown.
If things break bad enough, you'll get an exceptin thrown in your calling code. But, you can handle most errors in your proc.
It really is hard to say more, without knowing what language you're using to call the proc. .NET languages define exceptions you can catch that are specific to DB calls.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am using C#.net. My question in the interview was how do you perform error handling in sql server when you create a stored procedure.Where are the errors thrown not in .net in sql server.
yamini
|
|
|
|
|
yaminilatha wrote: If we create a stored procedure where and how is it saved and how is error handling done to the procedure. If any error occours where is it thrown. Help me.
Check the following link to get idea about procedures
http://w3hearts.com/articles/6/[^]
|
|
|
|
|
Thanx, this site was very useful.
|
|
|
|
|
Hi all,
I want to store Word document in SQL Server. Who can help me?
Datatype? Input? Example?
Thanks for reading this question.
|
|
|
|
|
It will be a BLOB, I would think.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you very much
|
|
|
|
|
|
I'm using VB.NET 2005
Thanks you.
|
|
|
|