Showing posts with label thanx. Show all posts
Showing posts with label thanx. Show all posts

Friday, March 30, 2012

how to create sdf file in c#

hi ,

i just want to create a sdf file using Sql server 2005 CE. I am very new to CE.

can anybody tell me how to create that file?

thanx in advance

Look into SqlCeEngine class.

|||San,

I have a whole series on my blog on how to use SSCE.
http://arcanecode.wordpress.com/arcane-lessons/

Lesson 2 talks about how to create the sdf, lesson 3 the table, and so on.

Hope it helps,

Arcane
|||

this is in vb.net just convert it

to C#

Imports System.Data.SqlServerCe

Public Class Form3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim repl As New SqlCeReplication()

repl.InternetUrl = "http://ServerName/snapshot/sqlcesa30.dll"
repl.InternetLogin = "<...>"
repl.InternetPassword = "<...>"
repl.Publisher = "ServerName"
repl.PublisherDatabase = "Merchandising_Dev"
repl.PublisherSecurityMode = SecurityType.DBAuthentication
repl.Publication = "DataPublication"
repl.Subscriber = "Sub1"
repl.HostName = "1" ' This is a prameter for filter the puplication'
repl.PublisherPassword = "password"
repl.PublisherLogin = "Sub1"

repl.SubscriberConnectionString = "Data Source=""\program files\aa.sdf"";Max Database Size=128;Default Lock Escalation =100;"
Try
repl.AddSubscription(AddOption.CreateDatabase)
repl.Synchronize()

Catch err As SqlCeException
MessageBox.Show(err.ToString)
End Try

End Sub
End Class

how to create sdf file in c#

hi ,

i just want to create a sdf file using Sql server 2005 CE. I am very new to CE.

can anybody tell me how to create that file?

thanx in advance

Look into SqlCeEngine class.|||San,

I have a whole series on my blog on how to use SSCE.
http://arcanecode.wordpress.com/arcane-lessons/

Lesson 2 talks about how to create the sdf, lesson 3 the table, and so on.

Hope it helps,

Arcane
|||

this is in vb.net just convert it

to C#

Imports System.Data.SqlServerCe

Public Class Form3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


Dim repl As New SqlCeReplication()

repl.InternetUrl = "http://ServerName/snapshot/sqlcesa30.dll"
repl.InternetLogin = "<...>"
repl.InternetPassword = "<...>"
repl.Publisher = "ServerName"
repl.PublisherDatabase = "Merchandising_Dev"
repl.PublisherSecurityMode = SecurityType.DBAuthentication
repl.Publication = "DataPublication"
repl.Subscriber = "Sub1"
repl.HostName = "1" ' This is a prameter for filter the puplication'
repl.PublisherPassword = "password"
repl.PublisherLogin = "Sub1"

repl.SubscriberConnectionString = "Data Source=""\program files\aa.sdf"";Max Database Size=128;Default Lock Escalation =100;"
Try
repl.AddSubscription(AddOption.CreateDatabase)
repl.Synchronize()

Catch err As SqlCeException
MessageBox.Show(err.ToString)
End Try

End Sub
End Class

Monday, March 19, 2012

how to create a socket/IP connection using SQL?

I just want to know how to create a socket/IP connection using SQL prodecure or function

please help..

thanx

Hi,

SQL Server does not provide an explicit way to create a socket. Could you please explain why you need this? Are you trying to establish a TCP/IP connection to SQL Server?

Thanks,

Il-Sung.