Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Wednesday, March 21, 2012

Help configuring database to work as intended

Hello everyone, I have created my web application in VS 2005 using asp.net 2.0 and the built in sql .mdf database creater that comes with visual studio. After I developed my website, I then wanted to move it to one of our servers on the network, which I did without a problem. The website works fine but here is my challange. I need users to be able to connect to the database via login script and the script inserts computer data into the database. So I figured I need to attach the Database to SQL Server 2005. When I try to do this it gives me this database is in use. So I stop the website in IIS, and it allows me to add the database into the SQL Server. Once I do this, and start the website again, the website no longer works and I get a bunch of database errors, that do not get fixed untill I re-copy the website to the server.

Is there a way to just connect to a .mdf file on the network that is not attached to a sql server, through a connection string in a login script? Maybe there is something else I need to do to the database before copying to the server? Or should I re-programm the website with a newly created database in SQL Server, and use that as the datasource?

There is no need to stop the webserver to copy or attach the database. to attach the database bring the particular database to offline and copy the mdf and ldf as per u r required location.

Thank u

Baba

Please remember to click "Mark as Answer" on this post if it helped you.

|||

Ok but then why, when I attach the database to a SQL Server, and try to run the website again, it no longer works? It gives me a bunch of database errors that basiaclly come down to, the database is already open.

|||

Hi,

using asp.net 2.0 and the built in sql .mdf datab

From your description, it seems that you want to move the mdf file in SQLExpress to SQLServer2005, right?

If so, I suggest that you can use aspnet_regsql tool to achieve that. The ASP.NET SQL Server Registration tool is used to create a Microsoft SQL Server database for use by the SQL Server providers in ASP.NET, or to add or remove options from an existing database. The Aspnet_regsql.exe file is located in the [drive:]\%windir%\Microsoft.NET\Framework\version folder on your Web server.

You can give the option '-d' to specify the name of the database to create or modify for use with application services. If the database is not specified, the default database name of "aspnetdb" is used.

For details, see:http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx

Thanks.

sql

Monday, March 19, 2012

Help about running SQL CE on Win CE 4.2

Hi everybody,

I developed mobile programs for WM5.0 with C#.NET using SQL Mobile. (Visual Studio 2005, SQL Server 2005 Mobile, Mobile SDK)

But I couldn't run SQL CE on WinCE 4.2 ? (Visual Studio 2003, SQL Server 2000 CE). For example on emulator, an Insert command is running successfully. But on device (Intermec CK 31) we are getting error.

Here is my code :

using System;

using System.Data;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data.SqlServerCe;

namespace UmurBS.Forms.BasimSayimForms

{

publicclass bsEkleForm : System.Windows.Forms.Form

{

private System.Windows.Forms.DataGrid dg;

private System.Windows.Forms.Button button1;

private System.Data.SqlServerCe.SqlCeConnection sqlceconn;

privatestring connstr = "DATA SOURCE = UmurDB.sdf";

public bsEkleForm()

{

InitializeComponent();

}

protectedoverridevoid Dispose( bool disposing )

{

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

privatevoid InitializeComponent()

{

this.button1 = new System.Windows.Forms.Button();

this.dg = new System.Windows.Forms.DataGrid();

//

// button1

//

this.button1.Location = new System.Drawing.Point(160, 264);

this.button1.Text = "button1";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// dg

//

this.dg.Location = new System.Drawing.Point(8, 8);

this.dg.Size = new System.Drawing.Size(224, 200);

this.dg.Text = "dg";

//

// bsEkleForm

//

this.ClientSize = new System.Drawing.Size(237, 291);

this.Controls.Add(this.dg);

this.Controls.Add(this.button1);

this.Text = "bsEkleForm";

}

#endregion

privatevoid button1_Click(object sender, System.EventArgs e)

{

sqlceconn = new System.Data.SqlServerCe.SqlCeConnection(connstr);

this.ekle();

}

privatevoid ekle()

{

try

{

SqlCeCommand cmd = new SqlCeCommand("insert into test (testValue) values ('hi world')", sqlceconn);

sqlceconn.Open();

int rowsaffected = cmd.ExecuteNonQuery();

}

catch(Exception exc)

{

MessageBox.Show(exc.Message);

}

finally

{

if (sqlceconn != null)

if (sqlceconn.State == ConnectionState.Open)

sqlceconn.Close();

}

}

}

}

Any idea ?

Regards

Serkan

In order to run SQL Mobile on WinCE 4.2 devices, you will have to request the following hotfix from Microsoft: http://support.microsoft.com/default.aspx/kb/924811

Hope this assists.

|||

Hi Erik

Actually I don't understand what must I do? Which files I must download? I have an Intermec CK 31 mobile device.

When I install CF 2.0 SP1 on it, I getting "not compatible" error. But completing install. But application does not run. :(

Thanks for any help , suggesstions.

Regards

Serkan

|||Which processsor architecture is your Intermec device based on - you must load the corresponding cabs for both .NET CF and SQL CE.|||

Hi Erik,

Processor is Intel XScale PXA255, 400 MHz . I think Architecture is ARM4.

|||

You need to call Microsoft support for the hotfix, for your Intermec device, you need to request the following files:

For ARMV4i-based devices

File name File version File size Date TimeSqlce30.dev.enu.wce4.armv4i.cabNot Applicable302,36802-Apr-200615:14Sqlce30.repl.wce4.armv4i.cabNot Applicable727,81902-Apr-200615:14Sqlce30.wce4.armv4i.cabNot Applicable1,586,50102-Apr-200615:14

as the only cab files made available for Windows CE 4.2 are for PocketPC devices, not general Windows CE 4.2 Devices.

ie: sqlce30.ppc.wce4.armv4.CAB, sqlce30.repl.ppc.wce4.armv4.CAB, sqlce30.dev.ENU.ppc.wce4.armv4.CAB

You may need to have a look at this as well: http://support.microsoft.com/kb/914829/

Help about running SQL CE on Win CE 4.2

Hi everybody,

I developed mobile programs for WM5.0 with C#.NET using SQL Mobile. (Visual Studio 2005, SQL Server 2005 Mobile, Mobile SDK)

But I couldn't run SQL CE on WinCE 4.2 ? (Visual Studio 2003, SQL Server 2000 CE). For example on emulator, an Insert command is running successfully. But on device (Intermec CK 31) we are getting error.

Here is my code :

using System;

using System.Data;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data.SqlServerCe;

namespace UmurBS.Forms.BasimSayimForms

{

public class bsEkleForm : System.Windows.Forms.Form

{

private System.Windows.Forms.DataGrid dg;

private System.Windows.Forms.Button button1;

private System.Data.SqlServerCe.SqlCeConnection sqlceconn;

private string connstr = "DATA SOURCE = UmurDB.sdf";

public bsEkleForm()

{

InitializeComponent();

}

protected override void Dispose( bool disposing )

{

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.button1 = new System.Windows.Forms.Button();

this.dg = new System.Windows.Forms.DataGrid();

//

// button1

//

this.button1.Location = new System.Drawing.Point(160, 264);

this.button1.Text = "button1";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// dg

//

this.dg.Location = new System.Drawing.Point(8, 8);

this.dg.Size = new System.Drawing.Size(224, 200);

this.dg.Text = "dg";

//

// bsEkleForm

//

this.ClientSize = new System.Drawing.Size(237, 291);

this.Controls.Add(this.dg);

this.Controls.Add(this.button1);

this.Text = "bsEkleForm";

}

#endregion

private void button1_Click(object sender, System.EventArgs e)

{

sqlceconn = new System.Data.SqlServerCe.SqlCeConnection(connstr);

this.ekle();

}

private void ekle()

{

try

{

SqlCeCommand cmd = new SqlCeCommand("insert into test (testValue) values ('hi world')", sqlceconn);

sqlceconn.Open();

int rowsaffected = cmd.ExecuteNonQuery();

}

catch(Exception exc)

{

MessageBox.Show(exc.Message);

}

finally

{

if (sqlceconn != null)

if (sqlceconn.State == ConnectionState.Open)

sqlceconn.Close();

}

}

}

}

Any idea ?

Regards

Serkan

In order to run SQL Mobile on WinCE 4.2 devices, you will have to request the following hotfix from Microsoft: http://support.microsoft.com/default.aspx/kb/924811

Hope this assists.

|||

Hi Erik

Actually I don't understand what must I do? Which files I must download? I have an Intermec CK 31 mobile device.

When I install CF 2.0 SP1 on it, I getting "not compatible" error. But completing install. But application does not run. :(

Thanks for any help , suggesstions.

Regards

Serkan

|||Which processsor architecture is your Intermec device based on - you must load the corresponding cabs for both .NET CF and SQL CE.|||

Hi Erik,

Processor is Intel XScale PXA255, 400 MHz . I think Architecture is ARM4.

|||

You need to call Microsoft support for the hotfix, for your Intermec device, you need to request the following files:

For ARMV4i-based devices

File name

File version

File size

Date

Time

Sqlce30.dev.enu.wce4.armv4i.cab

Not Applicable

302,368

02-Apr-2006

15:14

Sqlce30.repl.wce4.armv4i.cab

Not Applicable

727,819

02-Apr-2006

15:14

Sqlce30.wce4.armv4i.cab

Not Applicable

1,586,501

02-Apr-2006

15:14

as the only cab files made available for Windows CE 4.2 are for PocketPC devices, not general Windows CE 4.2 Devices.

ie: sqlce30.ppc.wce4.armv4.CAB, sqlce30.repl.ppc.wce4.armv4.CAB, sqlce30.dev.ENU.ppc.wce4.armv4.CAB

You may need to have a look at this as well: http://support.microsoft.com/kb/914829/

Friday, February 24, 2012

Help

Hi
I am using Visual studio 2005 to write a web service. I am not able to
connect to database. I get the usual Named pipes provider error:could
not open a connection to the server. So I read up some material and
found out that I have to start the sqlbrowser service(using surface
area configuration manager) and create exceptions for the firewall for
the sqlexpress and sqlbrowser. I did all the things, still I get the
same error. However , when I add the datasource from the datasource
configuration wizard and test the connection, the test was succesfull.
Thanks in advance for the helpIt's best not to hijack a thread with a new topic -there is no certainty
anyone will see your post since they may think that the thread is complete.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"sunil" <sairaj.sunil@.gmail.com> wrote in message
news:1154953948.775714.18740@.p79g2000cwp.googlegroups.com...
> Hi
> I am using Visual studio 2005 to write a web service. I am not able to
> connect to database. I get the usual Named pipes provider error:could
> not open a connection to the server. So I read up some material and
> found out that I have to start the sqlbrowser service(using surface
> area configuration manager) and create exceptions for the firewall for
> the sqlexpress and sqlbrowser. I did all the things, still I get the
> same error. However , when I add the datasource from the datasource
> configuration wizard and test the connection, the test was succesfull.
> Thanks in advance for the help
>|||This may not actually be a case of hijacking. It may just be a case of using
a totally meaningless subject that the newsreader assumes is part of the
same thread with the same less-than-useful subject.
HTH
Kalen Delaney, SQL Server MVP
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:uKT6kAmuGHA.4748@.TK2MSFTNGP03.phx.gbl...
> It's best not to hijack a thread with a new topic -there is no certainty
> anyone will see your post since they may think that the thread is
> complete.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "sunil" <sairaj.sunil@.gmail.com> wrote in message
> news:1154953948.775714.18740@.p79g2000cwp.googlegroups.com...
>

Sunday, February 19, 2012

Help

Hi
I am using Visual studio 2005 to write a web service. I am not able to
connect to database. I get the usual Named pipes provider error:could
not open a connection to the server. So I read up some material and
found out that I have to start the sqlbrowser service(using surface
area configuration manager) and create exceptions for the firewall for
the sqlexpress and sqlbrowser. I did all the things, still I get the
same error. However , when I add the datasource from the datasource
configuration wizard and test the connection, the test was succesfull.
Thanks in advance for the helpIt's best not to hijack a thread with a new topic -there is no certainty
anyone will see your post since they may think that the thread is complete.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"sunil" <sairaj.sunil@.gmail.com> wrote in message
news:1154953948.775714.18740@.p79g2000cwp.googlegroups.com...
> Hi
> I am using Visual studio 2005 to write a web service. I am not able to
> connect to database. I get the usual Named pipes provider error:could
> not open a connection to the server. So I read up some material and
> found out that I have to start the sqlbrowser service(using surface
> area configuration manager) and create exceptions for the firewall for
> the sqlexpress and sqlbrowser. I did all the things, still I get the
> same error. However , when I add the datasource from the datasource
> configuration wizard and test the connection, the test was succesfull.
> Thanks in advance for the help
>|||This may not actually be a case of hijacking. It may just be a case of using
a totally meaningless subject that the newsreader assumes is part of the
same thread with the same less-than-useful subject.
--
HTH
Kalen Delaney, SQL Server MVP
"Arnie Rowland" <arnie@.1568.com> wrote in message
news:uKT6kAmuGHA.4748@.TK2MSFTNGP03.phx.gbl...
> It's best not to hijack a thread with a new topic -there is no certainty
> anyone will see your post since they may think that the thread is
> complete.
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "sunil" <sairaj.sunil@.gmail.com> wrote in message
> news:1154953948.775714.18740@.p79g2000cwp.googlegroups.com...
>> Hi
>> I am using Visual studio 2005 to write a web service. I am not able to
>> connect to database. I get the usual Named pipes provider error:could
>> not open a connection to the server. So I read up some material and
>> found out that I have to start the sqlbrowser service(using surface
>> area configuration manager) and create exceptions for the firewall for
>> the sqlexpress and sqlbrowser. I did all the things, still I get the
>> same error. However , when I add the datasource from the datasource
>> configuration wizard and test the connection, the test was succesfull.
>> Thanks in advance for the help
>