Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Saturday, February 25, 2012

Connection error in sql server compact edition 2005

HI friends,

i m working on device application ..i m using sql server ce 2005 with c#.net ... but when i m trying to connect to database it shows me error that

"the database path not found ... please check the path [,,,filename,,,]"

my code is as below

private string ConnStr = "Data Source =\\My Documents\\Employee.sdf;";

private void cmdCheckConnecton_Click(object sender, EventArgs e)
{
try
{
cn = new System.Data.SqlServerCe.SqlCeConnection(ConnStr);
cn.Open();
MessageBox.Show(cn.State.ToString());
}
catch (SqlCeException ex)
{
MessageBox.Show(ex.Message.ToString());
}
}

i have my database in My Documents and the path is right still it shows the error

pls help if any one have a solution regarding this problem

thanxx

Zalak Shah

This is just a guess, but looking at my connection strings they have quotes around the Data Source, so maybe try adding those in.

private string ConnStr = "Data Source =\"\\My Documents\\Employee.sdf\";";

|||hi

i have done it but still it doesn't work

one more thing i want to tell u .. if i create the database on the same location even it is there it will create once again and no files will be create at that location that 's just a file in a memory .... and after that that memory file will accessed by that code and working perfectly as i needed

can u tell me one thing that location is in mobile device (Emulator) 's location or my hard drive's location

Connection error in sql server compact edition 2005

HI friends,

i m working on device application ..i m using sql server ce 2005 with c#.net ... but when i m trying to connect to database it shows me error that

"the database path not found ... please check the path [,,,filename,,,]"

my code is as below

private string ConnStr = "Data Source =\\My Documents\\Employee.sdf;";

private void cmdCheckConnecton_Click(object sender, EventArgs e)
{
try
{
cn = new System.Data.SqlServerCe.SqlCeConnection(ConnStr);
cn.Open();
MessageBox.Show(cn.State.ToString());
}
catch (SqlCeException ex)
{
MessageBox.Show(ex.Message.ToString());
}
}

i have my database in My Documents and the path is right still it shows the error

pls help if any one have a solution regarding this problem

thanxx

Zalak Shah

This is just a guess, but looking at my connection strings they have quotes around the Data Source, so maybe try adding those in.

private string ConnStr = "Data Source =\"\\My Documents\\Employee.sdf\";";

|||hi

i have done it but still it doesn't work

one more thing i want to tell u .. if i create the database on the same location even it is there it will create once again and no files will be create at that location that 's just a file in a memory .... and after that that memory file will accessed by that code and working perfectly as i needed

can u tell me one thing that location is in mobile device (Emulator) 's location or my hard drive's location

Connection Error

Hi friends ! , you may help me with this...

I have a report made with CR 8.0 that I call from VB6 application with a CrystalReport Control. When I execute myCrystalReport.Action = 0, an error raises: error number 20536, description: not possible to begin session in the server.
The report takes the data from a table in a Sql Server.

This is the code:

CR.ReportFileName = gstrPathReports & "\People.rpt"
CR.Action = 0

I also tried with:

CR.LogOnServer "P2SSQL.DLL", gstrCfgServerName & "\" & gstrCfgInstanceName, _
gstrCfgDBName, "sa", "hello"

but it still odesn't work...

Thanks for your help !Hi try the following
CR.ReportFileName = gstrPathReports & "\People.rpt"
CR.Action = 1
Madhivanan|||Now it says: "Cannot open the sql server"

Any other idea?

By the way, what's the difference between 0 and 1 in the Action?

Thanks !!!|||so its the problem of connection..not the printing.
Have you tried showing the report like Report.Show without passing the parameters for printing?
The problem with the connection may be due that, you are not passing correct user name and password in the parameters.
And secondly that the report ypu are not setting database location.

You can check for parameters in the sql server profiler, if the query is fine and checking the query in the query analyzer.|||My CrystalReport control doesn't have the Show method...

The password and username are ok, and the database location is also ok, because when I open the report from Seagate Crystal Report 8.0 it works fine.

The report doesn't have parameters, because it just shows columns from a table.

That's why I tried with LogOnServer, because the problem seems to be that I can't open the connection from the VB6 application when I invoke the report, but still doesn't work...

Thank you for any ideas !|||does your report have subreports?|||No, it doesn't...|||Hi vbUsername, check whether gstrCfgServerName & "\" & gstrCfgInstanceName gives correct server name that you are using.

Madhivanan|||Yes, they are ok, as well as the DBName, UID and PWD...

Thank you for your concern !
I just cannot make it work, and it's such a simple report !

Sunday, February 12, 2012

connecting to sql server over the internet

Hi friends,
I want to connecting my sql server over internet, can I
used nat in windows 2000 instead of proxy server ?
Thanks.I've normally used hardware based routers but there's no reason that either
solution you describe shouldn't work (at least that I can think of)
SQL will work fine with NAT from a hardware based solution.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"kresna rudy kurniawan" <anonymous@.discussions.microsoft.com> wrote in
message news:080f01c3b8a6$7a306620$a301280a@.phx.gbl...
> Hi friends,
> I want to connecting my sql server over internet, can I
> used nat in windows 2000 instead of proxy server ?
> Thanks.