Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Tuesday, March 27, 2012

Binding error

Hi all

I have a form view which uses a SQL data source control to retrieve it's data from the sql express database

the form view is used for view,edit,delete and insert data into the database

in the insert mode I have two dropdownlists, where the second one is depending on the first one to retrieve the correct data from the data baseBUT

when selecting a value in the first dropdownlist it give me the following erro:

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Please How can do this

any help is appriciated

bye

You cannt do this using this method. There are many work arrounds out there, but the easiest I believe is the CascadingDropDown control which is part of the AJAX.NET Control Toolkit.

http://www.asp.net/ajax/ -- Install the AJAX.NET FRAMEWORK AND configure your site to use it.

You will need to:

1.) First Create a Web Service Class like as followed:

using System;using System.Web;using System.Collections;using System.Configuration;using System.Web.Services;using System.Web.Services.Protocols;using System.Collections.Generic;using AjaxControlToolkit;using System.Data;using System.Data.SqlClient;using System.Web.Script.Services;/// <summary>/// Cascading DropDownList AjaxControlToolkit Web Service/// </summary>[WebService(Namespace ="http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][System.Web.Script.Services.ScriptService]public class DataService : System.Web.Services.WebService { private string connectionString =ConfigurationManager.ConnectionStrings["CarrierDBConnectionString"].ConnectionString; public DataService () {} [WebMethod] [System.Web.Script.Services.ScriptMethod()] public CascadingDropDownNameValue[] GetCarriers(string knownCategoryValues, string category) { List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); using (SqlConnection conn = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand("CARRIER_SELECT_ALL", conn)) { cmd.CommandType = CommandType.StoredProcedure; conn.Open(); SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { values.Add(new CascadingDropDownNameValue((string)dr["NAME"], dr["ID"].ToString())); } } } return values.ToArray(); } [WebMethod] [System.Web.Script.Services.ScriptMethod()] public CascadingDropDownNameValue[] GetSubsidiariesByCarrierID(string knownCategoryValues, string category) { List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>(); using (SqlConnection conn = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand("CARRIER_SELECT_SUBSIDIARY_BYID", conn)) { string[] categoryValues = knownCategoryValues.Split(':', ';'); int id = Convert.ToInt32(categoryValues[1]); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@.id",id); conn.Open(); using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)) { if (dr.HasRows) { while (dr.Read()) { values.Add(new CascadingDropDownNameValue((string)dr["NAME"], dr["ID"].ToString())); } } } } }return values.ToArray(); }}

2.) Create the Actual Web Service

Click on the Project in the 'Solution Explorer' and 'Add New Item' and then select Web Service (for instance in this example: DataService.asmx)

3.) Hook up your ajax controls and dropdownlist


<asp:UpdatePanel ID="updatePnlInsert" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlCarrierInsert" runat="server" AutoPostBack="True" Width="100%" DataSourceID="sqldsCarriersInsert" DataTextField="NAME" DataValueField="ID" SelectedValue='<%# Eval("CARRIER_ID") %>' AppendDataBoundItems="true">
<asp:ListItem Value="" Text="<select carrier>" />
</asp:DropDownList>
<br />
<asp:SqlDataSource ID="sqldsCarriersInsert" runat="server" ConnectionString="<%$ ConnectionStrings:CarrierDBConnectionString %>"
SelectCommand="CARRIER_SELECT_ALL" SelectCommandType="StoredProcedure" />

<asp:DropDownList ID="ddlSubInsert" runat="server" Width="100%" /><br />
<cc1:CascadingDropDown ID="cddCarrierInsert" runat="server"
TargetControlID="ddlSubInsert"
ParentControlID="ddlCarrierInsert"
Category="CARRIER"
LoadingText="[Loading Subsidiaries...]"
PromptText="<select subsidary>"
ServiceMethod="GetSubsidiariesByCarrierID"
ServicePath="DataService.asmx"
SelectedValue='<%# Eval("SUBSIDIARY_ID") %>'>
</cc1:CascadingDropDown>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCarrierInsert" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>

Hope this helps.

Binding a DataSource Table column to a form object (RadioButtons)

Hi,

I have a little question. I have an application which interfaces with a SQL Express Database. On a form, I want to bind a control which is made of several Radio buttons to a table column which is in fact a varchar(1). This is the picture:

Table column: OptVisualRpt varchar(1)

Screen control: 2 radio buttons

rb_VisRPTbImp_O for "yes"

rb_VisRPTbImp_N for "no"

I'm really scratching my head as how I can bind a single table column to my radio buttons controls. I think that I just can't this way but rather have to use an intermediate variable or control.

Solution 1?

I thought of using a local variable that I would set to "y" or "n" following "CheckedChanged" events fired from radio buttons but I don't know how to bind this variable to my table column.

Solution 2?

I thought of placing a hidden text control into my form, which one would be binded to my table column, that I would also set to "y" or "n" following "CheckedChanged" events fired from radio buttons.

Any of these solutions which would be feasible or any more neat way to do it?

Many thanks in advance,

Stphane

Hi again,

Finally sounds that last night I could solve my problem by myself. Let me explain.

1- I first got rid of the "Binding source". I removed following lines:

=> private: System::Windows::Forms::BindingSource ^ InfoBaseBindingSource;

=> this->InfoBaseBindingSource = (gcnew System::Windows::Forms::BindingSource(this->components));

=> (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->InfoBaseBindingSource))->BeginInit();

=> //
// InfoBaseBindingSource
//

this->InfoBaseBindingSource->DataMember = L"InfoBase";
this->InfoBaseBindingSource->DataSource = this->Test_ADODataSet;

=> (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->InfoBaseBindingSource))->EndInit();

2- At the same time, for every field control that were fed by it, I removed from code the following line (here is an example):

this->ID_Compagnie->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text", this->InfoBaseBindingSource, L"Identification", true)));

3- I then changed the Form1_Load routine for the following:

this->InfoBaseTableAdapter->Fill(this->Test_ADODataSet->InfoBase);

DataTable ^ Dt_Infobase = this->Test_ADODataSet->Tables["InfoBase"];
if(Dt_Infobase != nullptr)
{
array<DataRow^> ^ Rw_InfoBase = Dt_Infobase->Select();
if(Rw_InfoBase->Length != 0)
{
this->ID_Compagnie->Text = Rw_InfoBase[0]["Identification"]->ToString();
this->Adr_Compagnie->Text = Rw_InfoBase[0]["Adresse"]->ToString();
...

==> Example of loading a masked text box

// Affichage et rectification du format du Code Postal/ZipCode

if(String::Compare(this->Pays_Compagnie->Text,"Canada") == 0)
{
this->CPZip_Compagnie->Mask = ">L0>L 0>L0";
this->Pnl_VSZCode->Hide();
}
else
{
this->Pnl_VSZCode->Show();
if(this->CPZip_Compagnie->Text->Length > 5)
{
this->VScrl_ZCode->Value = 1;
this->CPZip_Compagnie->Mask = "99999";
}
else
{
this->VScrl_ZCode->Value = 0;
this->CPZip_Compagnie->Mask = "99999-9999";
}
}

this->CPZip_Compagnie->Text = Rw_InfoBase[0]["CodePostal_Zip"]->ToString();

...

==> Example of "loading" info vs a set of radio buttons

String ^ Logo_ModeAff = Rw_InfoBase[0]["LogoRpt_ModeAff"]->ToString();
if(Logo_ModeAff == "C")
{
this->rb_ModeAffLCoord->Checked = true;
this->rb_ModeAffLOnly->Checked = false;
}
else
{
this->rb_ModeAffLCoord->Checked = false;
this->rb_ModeAffLOnly->Checked = true;
}
}

4- I then changed the B_Accept_Click routine for the following:

I removed following sentences:

this->InfoBaseBindingSource->EndEdit();
this->InfoBaseTableAdapter->Update(this->Test_ADODataSet->InfoBase);
this->Test_ADODataSet->AcceptChanges();

And replaced them with following:

DataTable ^ Dt_Infobase = this->Test_ADODataSet->Tables["InfoBase"];
if(Dt_Infobase != nullptr)
{
array<DataRow^> ^ Rw_InfoBase = Dt_Infobase->Select();
if(Rw_InfoBase->Length == 0)
{
DataRow ^ NRw_InfoBase = Dt_Infobase->NewRow();

NRw_InfoBase["Identification"] = this->ID_Compagnie->Text;
...
==> Example of a "saving" info vs a set of radio buttons

if(this->rb_ModeAffLCoord->Checked == true)
NRw_InfoBase["LogoRpt_ModeAff"] = "C";
else
NRw_InfoBase["LogoRpt_ModeAff"] = "L";
...

Dt_Infobase->Rows->Add(NRw_InfoBase);
}
else
{
Rw_InfoBase[0]["Identification"] = this->ID_Compagnie->Text;
...
==> Example of a "replacing" info vs a set of radio buttons

if(this->rb_ModeAffLCoord->Checked == true)
Rw_InfoBase[0]["LogoRpt_ModeAff"] = "C";
else
Rw_InfoBase[0]["LogoRpt_ModeAff"] = "L";
...
}

this->InfoBaseTableAdapter->Update(this->Test_ADODataSet);
this->Test_ADODataSet->AcceptChanges();
}

5- I finally changed the B_Cancel_Click routine for the following:

I removed following sentences:

this->InfoBaseBindingSource->EndEdit();

This code is maybe not the best way to do it. If someone has any more proper way to do it, I would certainly appreciate to learn. My conclusion is that doing this binding process manually gives better results than relying on a BindingSource object.

Stphane

Thursday, March 8, 2012

BI Development Studio Licensing and VS Express Edition

If we have a fully functional and Licensed Report Server 2005, can we allow
people using Visual Studio Express to develop reports?
I our shop we have two types of report developers, The first type is the
full blast developer that has the full Visual Studio product. The second
type does scripting and some light programming using the express products.
ThanksRS 2000 and RS 2005 are totally different in this respect. RS 2000 required
VS to install the designer into. RS 2005 will use VS if it is there but it
is not required. It will install its own copy if there is no VS. What this
means is that there is no dependency from either a physical or a licensing
perspective. VS is not needed for RS 2005 designer.
My guess is if VS Express is there it will install with it but that is just
a guess. As far as allowing, from a licensing perspecitve there is no
problem. Will it work, my guess is yes.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<hpux9@.nospam.nospam> wrote in message
news:26671BEE-78BA-4540-9B52-661A86BC65A6@.microsoft.com...
> If we have a fully functional and Licensed Report Server 2005, can we
> allow
> people using Visual Studio Express to develop reports?
> I our shop we have two types of report developers, The first type is the
> full blast developer that has the full Visual Studio product. The second
> type does scripting and some light programming using the express products.
> Thanks|||Bruce,
Thanks for the reply. I have installed RS 2005 designer on 2 workstations.
Workstation 1 has a licensed copy of VS2005, the install integrated with VS
2005 as expected.
The second PC had a copy of C# Express. On this box the install dropped
down a copy of VS that only had the BI project types (which is good!).
The only issue I see is that I had to enter the SQL 2005 license key (in
both cases) to get to the screen where I selected RS 2005 designer. If the
designer is trully "free" how am I going to get the software to the
developers?
Thanks!
"Bruce L-C [MVP]" wrote:
> RS 2000 and RS 2005 are totally different in this respect. RS 2000 required
> VS to install the designer into. RS 2005 will use VS if it is there but it
> is not required. It will install its own copy if there is no VS. What this
> means is that there is no dependency from either a physical or a licensing
> perspective. VS is not needed for RS 2005 designer.
> My guess is if VS Express is there it will install with it but that is just
> a guess. As far as allowing, from a licensing perspecitve there is no
> problem. Will it work, my guess is yes.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> <hpux9@.nospam.nospam> wrote in message
> news:26671BEE-78BA-4540-9B52-661A86BC65A6@.microsoft.com...
> > If we have a fully functional and Licensed Report Server 2005, can we
> > allow
> > people using Visual Studio Express to develop reports?
> >
> > I our shop we have two types of report developers, The first type is the
> > full blast developer that has the full Visual Studio product. The second
> > type does scripting and some light programming using the express products.
> >
> > Thanks
>
>|||The install comes via the SQL Server 2005 CD, which requires a license key.
I don't see any way around this. You don't need additional server licenses
to install the design tool but you do need to be able to run the setup from
the CD.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<hpux9@.nospam.nospam> wrote in message
news:537D168E-4133-4D41-873A-204E89902F83@.microsoft.com...
> Bruce,
> Thanks for the reply. I have installed RS 2005 designer on 2
> workstations.
> Workstation 1 has a licensed copy of VS2005, the install integrated with
> VS
> 2005 as expected.
> The second PC had a copy of C# Express. On this box the install dropped
> down a copy of VS that only had the BI project types (which is good!).
> The only issue I see is that I had to enter the SQL 2005 license key (in
> both cases) to get to the screen where I selected RS 2005 designer. If
> the
> designer is trully "free" how am I going to get the software to the
> developers?
> Thanks!
> "Bruce L-C [MVP]" wrote:
>> RS 2000 and RS 2005 are totally different in this respect. RS 2000
>> required
>> VS to install the designer into. RS 2005 will use VS if it is there but
>> it
>> is not required. It will install its own copy if there is no VS. What
>> this
>> means is that there is no dependency from either a physical or a
>> licensing
>> perspective. VS is not needed for RS 2005 designer.
>> My guess is if VS Express is there it will install with it but that is
>> just
>> a guess. As far as allowing, from a licensing perspecitve there is no
>> problem. Will it work, my guess is yes.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> <hpux9@.nospam.nospam> wrote in message
>> news:26671BEE-78BA-4540-9B52-661A86BC65A6@.microsoft.com...
>> > If we have a fully functional and Licensed Report Server 2005, can we
>> > allow
>> > people using Visual Studio Express to develop reports?
>> >
>> > I our shop we have two types of report developers, The first type is
>> > the
>> > full blast developer that has the full Visual Studio product. The
>> > second
>> > type does scripting and some light programming using the express
>> > products.
>> >
>> > Thanks
>>|||Bruce,
There are some features that you will not be able to use if you only
develop using BIDS though from what I have heard. What about custom code?
Custom assemblies? Is BIDS a fully functional replacement for developing
robust reports that need major customization (functions, code, assemblies)?
I need to know this. As far as I can see ... it will only install a BI
project type so where do you test custom code for example? I cant create a
custom assembly that is shared across all reports using BIDS alone. If I am
misunderstanding ... great. If I am not ... then I think it is important to
make sure people know that they will be losing function if they just go with
BIDS.
"Bruce L-C [MVP]" wrote:
> RS 2000 and RS 2005 are totally different in this respect. RS 2000 required
> VS to install the designer into. RS 2005 will use VS if it is there but it
> is not required. It will install its own copy if there is no VS. What this
> means is that there is no dependency from either a physical or a licensing
> perspective. VS is not needed for RS 2005 designer.
> My guess is if VS Express is there it will install with it but that is just
> a guess. As far as allowing, from a licensing perspecitve there is no
> problem. Will it work, my guess is yes.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> <hpux9@.nospam.nospam> wrote in message
> news:26671BEE-78BA-4540-9B52-661A86BC65A6@.microsoft.com...
> > If we have a fully functional and Licensed Report Server 2005, can we
> > allow
> > people using Visual Studio Express to develop reports?
> >
> > I our shop we have two types of report developers, The first type is the
> > full blast developer that has the full Visual Studio product. The second
> > type does scripting and some light programming using the express products.
> >
> > Thanks
>
>|||BIDS is for designing reports. You can do code behind reports but you cannot
do custom assemblies. If you do that you need VB.Net (or C# etc). A whole
lot of people are desinging reports only. Previously it was a big hassle,
they would be installing VS just for the report designer. If they are doing
that then they would not be doing anything you are talking about.
I disagree they are losing functionality. RS 2000 had to have some product
installed that had VS to get the designer installed. The designer previously
did not give you the tools to do anything that you mentioned (create custom
assemblies for example). Obviously if you are creating your own web pages
then you need a designer to do so. If you are creating your own custom
assemblies ditto. However, most people are not doing that (creating custom
assemblies).
There are two markets. People who are tightly integrating into their own app
or are integrating in their own data extensions or authentication. I'd say
the vast majority are not doing that. The others are using Report Manager
portal as is.
Obviously you are not doing that. Your type of development is why VS 2005
has the new controls. Note these controls do not come with RS 2005, you have
to purchase VS 2005 to get these (or VB.Net 2005 etc). Just for the controls
anyone integrating with their own app should get VS 2005.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MJT" <MJT@.discussions.microsoft.com> wrote in message
news:94B2AA1F-AC25-4B6C-A29C-FD268445CA99@.microsoft.com...
> Bruce,
> There are some features that you will not be able to use if you only
> develop using BIDS though from what I have heard. What about custom code?
> Custom assemblies? Is BIDS a fully functional replacement for developing
> robust reports that need major customization (functions, code,
> assemblies)?
> I need to know this. As far as I can see ... it will only install a BI
> project type so where do you test custom code for example? I cant create
> a
> custom assembly that is shared across all reports using BIDS alone. If I
> am
> misunderstanding ... great. If I am not ... then I think it is important
> to
> make sure people know that they will be losing function if they just go
> with
> BIDS.
> "Bruce L-C [MVP]" wrote:
>> RS 2000 and RS 2005 are totally different in this respect. RS 2000
>> required
>> VS to install the designer into. RS 2005 will use VS if it is there but
>> it
>> is not required. It will install its own copy if there is no VS. What
>> this
>> means is that there is no dependency from either a physical or a
>> licensing
>> perspective. VS is not needed for RS 2005 designer.
>> My guess is if VS Express is there it will install with it but that is
>> just
>> a guess. As far as allowing, from a licensing perspecitve there is no
>> problem. Will it work, my guess is yes.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> <hpux9@.nospam.nospam> wrote in message
>> news:26671BEE-78BA-4540-9B52-661A86BC65A6@.microsoft.com...
>> > If we have a fully functional and Licensed Report Server 2005, can we
>> > allow
>> > people using Visual Studio Express to develop reports?
>> >
>> > I our shop we have two types of report developers, The first type is
>> > the
>> > full blast developer that has the full Visual Studio product. The
>> > second
>> > type does scripting and some light programming using the express
>> > products.
>> >
>> > Thanks
>>

BI Application & SQL Server Express Edition

I was wondering whether anyone could enlighten me:
We currently build DB apps with a jet engine DB and c# Windows Form front end.
We wish to develop client windows form apps that can be installed on client PCs, which will have an SQL Server back-end and windows form Front End. However the apps we want to build are BI application using cubes we generate (in Analysis Services).
Now am I right in saying that we cannot develop an application that can be installed on a customer site that would include SQL Server Expres AND have the BI functionality? We wish to build a tool for customers that allows them to slice and dice data we provide

It is a pre-requisite that we must not assume that they have access to the internet and we cannot assume that they have an SQL Server which we could automatically install our product onto (to allow for BI functionailty).
So far all the tools we seen and the end-to-end applications, tend to refer to a pre-exisitng installation of SQL Server (with Analysis Services) e.g. Programmming SQL Server 2005 - Microsoft Press.
We need to create custom apps that can "stand alone". Is there any solution?

First. Analysis Services component of the Microsoft SQL Server 2005 product is not part of the Express Edition. It is part of any other edition of SQL Server ( except may be for the mobile edition )

This doesnt mean you cannot install Express and Standard editions of SQL Server side.

Now there is wide range of functionality supported by Analysis Services. You have to figure out what you would like to provide your users with.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Wednesday, March 7, 2012

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

Sunday, February 19, 2012

Best way to set up so I can Connect vb express to SQL2005 Developer ed?

Excuse the cross post (to VBexpress fourum) but maybe someone here will have a different take?

have searched all around can't seem to see how to configure a SQL2005 developer ed so I can use vb express to develop a local front end. keep getting "the user instance login flag is not supported on this version of sql server" I have configured the .net framework via aspnet_regsql.exe. Also I configured the "Machine.config" file. but so far no luck.

Selecting sql2005 as the server thru the add new database connection in advanced area yields the error message

surely there is away.

So far still no joy,

While Scotty indicates that the connection to SQL2005 is intentionally hampered other posters indicate that the user instance problem can be solved by running the .net config tool to add the asp database to sql server, which I have done.

However this does not yet work.

I cannot get the code to spark yet.

Again my configuration cannot be any simpler. sql express sp1 and sqldeveloper on the same machine using windows security (all installed with default cofigurations)

In the absence of other ideas I may try to get sql express downloaded and going, I'm not sure what issues that will present re: what I'm trying to develop.

I'm trying to develop the skills to replace some fairly involved reporting and some user table interface that I had going in access2003, I hate to pruchace a big piece of sw when I don't know if it will remove the current roadblocks...

Appreciate the help here, but doesn't someone have a "simpler" complete answer? I.e. one that would get the developer database to accept the connection wizard? (user instance issue)

Hi,

1). Are you able to Log In using Windows User Login credential on your SQL Server machine?

2). Have you cross check connection string?! Refer http://www.connectionstrings.com/

3). Is remote access , tcp/ip,named pipe are enabled and running properly?

4). SQL Server Browser service is running ?

5). Have check for any dependency service has problem?

6). RPC Service is running?

7). Have you check with Firewall settings?

8). Can both machine (Server/Client) ping each other?

9). What error message you got ?

Hemantgiri S. Goswami

|||

The following answers and eliminates many of the questions you pose...

I guess that MS doesn't want this envionment option to exist?

If you could answer I think it would solve a number of hanging queries.

Thank you for responding, I have temporarily given up on this quest since I have to get some real work done! ;') I went ahead and downloaded sql express and fidled a bit and now have it running with vb express and sql developer but it appears that the barriers are fairly high between the two enviornments...

Assume I want to start from scratch, one machine.....

Not answereing your questions precisely but asking a new one. With everthing operating on one machine under windows authentication using the default installation options for each product, what would be the correct (best) way to get the vb express to talk to sql developer?

Also it would be great to have the sql management studio be able to move the tables between the two environments...

All I'm trying to do is get the "best" developoment environment I can at a low cost.

|||

hi,

tomdart wrote:

Excuse the cross post (to VBexpress fourum) but maybe someone here will have a different take?

have searched all around can't seem to see how to configure a SQL2005 developer ed so I can use vb express to develop a local front end. keep getting "the user instance login flag is not supported on this version of sql server" I have configured the .net framework via aspnet_regsql.exe. Also I configured the "Machine.config" file. but so far no luck.

...

Appreciate the help here, but doesn't someone have a "simpler" complete answer? I.e. one that would get the developer database to accept the connection wizard? (user instance issue)

Visual Studio Express editions designers are "designed" to use only "file based" connections and thus User Instances features... you can connect to SQL Server engine (Developer edition as well), but only by code and not via the designers..

regards

|||

Andrea Montanari wrote:

hi,

tomdart wrote:

Excuse the cross post (to VBexpress fourum) but maybe someone here will have a different take?

have searched all around can't seem to see how to configure a SQL2005 developer ed so I can use vb express to develop a local front end. keep getting "the user instance login flag is not supported on this version of sql server" I have configured the .net framework via aspnet_regsql.exe. Also I configured the "Machine.config" file. but so far no luck.

...

Appreciate the help here, but doesn't someone have a "simpler" complete answer? I.e. one that would get the developer database to accept the connection wizard? (user instance issue)

Visual Studio Express editions designers are "designed" to use only "file based" connections and thus User Instances features... you can connect to SQL Server engine (Developer edition as well), but only by code and not via the designers as all editions but SQLExpress do not support User Instances..

regards

|||

Just to give "official" confirmation to what Andrea has already indicate, and provide more detail...

VS Express Editions are designed to work exclusively with SQL Express in terms of creating database through the UI and including them into your project. To this end, the following is true:

When you create a database using the VS Express UI, VS verifies the version of SQL being accessed is SQL Express. Any other version will fail.|||Thanks for the confirmation, I'm only doing development, learning and testing, but the signifigant restrictions of express and developer seem to make it pretty difficult. E.G. no effective import to express and no language (VB) in developer. Hence the need to use both to develop.|||

Hi tomdart,

If you want to import from Access I suggest you check out the Migration Assistant for Access that was recently released. This will get your Access data into SQL.

Mike

|||

Thank you for your reply, the following presented in the spirit of constructive feedback.

What I was hoping to do was simply import a text file, csv which is no problem with access, but simply cannot be done in sql express. I have managed , after hours to get the import going in sql developer since I can see and modify the package, but the lousy import and poor design of defaults makes the text import of express vitually a deal killer for my use. I may resort to import to access then import to express, but that seems like a sub optimal solution! I would add that native ssis in sql-developer is no champ to work with either. I don't get why the sophisticated folks at msft could not have either ssis or text import of SQL work as intellegently as Access. It seems that the defaults and error handeling just arn't as well set up, perhaps a "default mode" (which could be more intellegent or forgiving) of some sort could be added? As it now stands I regard this area as the "worst" from an everyday use perspective.

As to SSIS in sql developer, (and hence the big sql) I can't even find good doccumentation on how to modify a wizzard generated ssis package, The generated XML appears to be fairly inscrutable, and undoccumented.

|||

Hi tomdart,

Thanks for the feedback. I wasn't here when they made the decision to remove Import/Export from Express and I'm working to having at least in import solution in the next version. Your comments will help support my claim.

As another alternative I can suggest the BCP utility which can handle import and export of text based data.

Mike

Friday, February 10, 2012

Best way to connect from VB6

I'm currently working on a project that is going to read/write lot of data into a SQL EXPRESS 2005.

What is BEST WAY(faster and reliable) for connecting, reading, writing updating from VB6...

The code below is working except the RecordCount that always returns -1

I've tried to do a Movelast before, doing so produce this error --> rowset does not support fetching backward

Private ObjConn As New ADODB.Connection
Private ObjRS As New ADODB.Recordset

...

in a function....
Dim i As Integer, j As Integer

With ObjConn
.ConnectionTimeout = 30
.CommandTimeout = 30
.Provider = "SQLOLEDB"
.ConnectionString = "Driver={SQL Native Client};Server=MACHINE\SQLEXPRESS;Database=DSD;UID=sa;PWD=MYPass;"
End With
ObjConn.Open
strRequest = "SELECT * FROM dbo.Site"
ObjRS.Open strRequest, ObjConn
j = 0
MsgBox ObjRS.RecordCount ' How to get NUMBER OF RECORDS BEFORE LOOPING ?

Do While Not ObjRS.EOF
task(j).SiteID = ObjRS.Fields(ObjRS.Fields(0).Name).Value
' THIS SECTIONS WORKS
ObjRS.MoveNext

j = j + 1
Loop
ObjConn.Close
test = task
End FunctionThanks for helping ! I'm stuck in the middle...

Merci

For MsgBox ObjRS.RecordCount ' How to get NUMBER OF RECORDS BEFORE LOOPING ?

Try one of the following

1) ObjRS.CursorLocation = adUseClient

2) ObjRS.Open strRequest, ObjConn, adOpenKeyset

Hope this helps

|||

The reason you can not move backwards or get the record count is because of the fact that you are getting the SQL Server Firehose cursor as a result. You can not get the record count until you reach the last record for your query. Similarly Firehose cursors do not support going backwards. The advantage of firehose cursors is that they are the fastest way of fetching SQL Server data, however they do not support updates. If you want to perform updates you have to request different cursor types when calling Open on the Recordset object. For example if you use Static cursor using adOpenStatic parameter to Open you will get the Recordcount correctly. Read the section title : "Understanding Cursors and Locks" in the ADO documentation in MSDN.

Thanks

Waseem Basheer

|||

RecordCount returns -1 when you are using a forward-only cursor or a dynamic cursor (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprorecordcount.asp). Since the default is a forward only cursor, that would explain the behavior that you're seeing.

As Waseem mentions, this cursor type would also explain the behavior you're seeing with MoveLast.

If you switch to using a static cursor, this property should have the row count value that you were expecting (the code snippet doesn't appear to have any need to update data, so this would presumably be sufficient).