Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Sunday, 25 March 2012

Connect to remote SQL Server from local Web App

I have a SQL Server 2005 instance which resides on a dedicated server hosted by a third party. I am able to connect to this server through my local SQL Management Studio, however, my local ASP.NET 2.0 web application cannot connect. I get the error below. The connection string I use is formatted as...

Connection String:

Server=thesever;uid=myuserid;pwd=mypassword;database=mydatabase

Error:

Failed to connect to database: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

The hosting providr claims that the SQL Server configuration settings are as they should be as fars as TCP/IP and Named Pipes are concerned. Does anyone know what might be going on?

I believe I have found the problem. There was a problem creating the proper conneciton string.sqlsql

Thursday, 22 March 2012

Connect to Local

Hey Guys,

I have a SQL connection string question. In my web.config I don't know what to put for the server. I have SQL Server 2005 installed locally.

<connectionStrings>
<add name="database" providerName="System.Data.SqlClient" connectionString= "server=whatgoeshere?;database=test;uid=sa;pwd=password" />
</connectionStrings>

I'm using VS 2005.

Thanks in advance.

-Marc

Try:
(local)

|||

thanks for the reply.

I'm trying to see if the connection string works using "local" but I'm having trouble with my code.

When I add this line: Dim sqlConn as new SQLconnection the "SQLconnection" errors.

I've tried importing SQL at the top but still doesn't work. Is there some reference I need to add?

Thanks.

|||

C# is case sensitive.

It should be Dim sqlConn as new SqlConnection();

|||

I'm actually using VB.

On this line: Dim SqlConn as New SqlConnection() the "SqlConnection()" has the blue line under it indicating an error.

I'm trying to figure out if I need to Import a namespace or maybe when I installed VS2005 I did something wrong.

Thanks.

|||

Try importing:
System.Data.SQLClient

|||

augustwind thanks for the help... it works. Using local for the db and using the import you suggested.

I have a quick question that you might be able to anwer. It VS 2003 whenever I would create a new proj it would store it in the C:\Inetpub\wwwroot blah blah blah. But when I create a new proj in VS2005 it saves it somewhere else. Do you know why that is?

Thanks again.

|||

Sorry - I know where - but I don't know why - -

Big Smile

Connect to internal SharePoint database from web site.

Hello,
There's information on my Internal SharePoint DataBase that I want to access. How can I do this? Could you help me or at least point me in the right direction.

The information I am requesting is just text.

Thank you,
Mark

Hi Mark,

I don't think so that kind of info is available. The table structure and relationships are quite messy. It's not recommended to access those tables directly, not to say it's prohibited.

I have done a lot of Sharepoint customizations, and what I did was accessing the Sharepoint internal object with it's object model. You can download the WSS SDK (both 2.0 and 3.0), and install it. The help file in the SDK has alot of sample code that we can use.

Happy coding :)

|||

Hi Mark,

I don't think so that kind of info is available. The table structure and relationships are quite messy. It's not recommended to access those tables directly, not to say it's prohibited.

I have done a lot of Sharepoint customizations, and what I did was access the Sharepoint internal object with it's object model. You can download the WSS SDK (both 2.0 and 3.0) are available. There are alot of sample code that we can use.

Happy coding :)

|||

Hi Mark,

I don't think so that kind of info is available. The table structure and relationships are quite messy. It's not recommended to access those tables directly, not to say it's prohibited.

I have done a lot of Sharepoint customizations, and what I did was accessing the Sharepoint internal object with it's object model. You can download the WSS SDK (both 2.0 and 3.0), and install it. The help file in the SDK has alot of sample code that we can use.

Happy coding :)

|||

I am starting to see this now. Thank you for your response.

Tuesday, 20 March 2012

Connect to Analysis Services with specific username

Hello,

We are trying to develop an ASP .Net web application that connects to an SQL Server 2005 analysis services and executes MDX statements. We want the connection to be made using a specific user name that we specify in the code rather than having the web application inherit the logged on domain user account.

We tried to specifiy the user name in the connection string as follows, but it is still taking the logged in user account rather than the one specified.

Microsoft.AnalysisServices.Server s = new Microsoft.AnalysisServices.Server();

s.Connect("Provider=MSOLAP.3;Password=123;Persist Security Info=True;User ID=domain\username;Data Source=<server ip>;Initial Catalog=<analysis DB>");

Is this possible?

Note that if we are using the OLEDB 9.0 provider for Analysis Services to connect an excel sheet to the analysis database we can easily specify the user name and password, so is there a similar way to do the same from a .Net application?

Any feedback is appreciated, thanks,

Grace

If you want to use a Windows Indentity, then you can′t. For other connection options refer to the connection properties which are shown e.g. here:

http://www.ssas-info.com/ssas_articles/ssas_articles/analysis_services_2000_and_2005_connection_string_properties.html


Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Thanks Jens,

The link helped a lot. We were able to connect using specific Roles and that is what we were looking for exactly but didn't know it exists.

Grace

Connect to an NS instance on remote server

I have Sql Server 2005 and Notification Services on one machine and I am developing a web app on another machine that will be front-end to the NS instance. So far all the examples I've seen for connecting to an instance using NS API assume that Sql Server, Notification Services and the development environment are on the same machine. Is it possible to connect to an instance on a remote machine using NS API? If so, how can it be done?

On the machine hosting your web app, you'll need to register the NS instance. When you register instance, you specify the name of the database server hosting the NS instance and the sql username/password used to connect to it, if you're using sql auth. Once you've created the registration, you can then use the NS API just like you would if the sql server were local: you create an instance of the NSInstance class, passing the instance name. The NSInstance implementation will read the server/connection information from the registry.

To register the instance, you have two options:
- On the web server machine, run nscontrol register, passing the name of your SQL Server (not the local machine) to the -server parameter.
- On the web server machine, run SQL Server Management Studio, connect the Object Explorer to the SQL Server hosting your instance's databases, right click on the instance name in the Notification Services folder and choose "Register" from the context menu.

Whichever tool you choose (nscontrol or management studio), you must run it locally on the web server box.
Hope this helps.
-shyam

|||Shyam is right that you need to register the instance.

There is also a third option to do the registration:
- You can use the Microsoft.SqlServer.Management.Nmo.Instance.RegisterLocal method to do the registration at runtime. There are class and instance based overloads that you can choose from to meet your needs. As the name suggests, you have to execute it on the locally on the web server box.

Whether you choose to do your registration at runtime or as part of your deployment steps (using the options Shyam mentions) you have to do it before you initialize the NSInstance object.

Hope that helps.
Anand

connect to an instance?

How do I connect to an instance of a database

which is in a web application (not published) with SQL server management studio express?

I seem to be able to connect to the data base created ......but not after i have added

it into my web app?

does that make sense

er found a ton of videos onit

Thursday, 8 March 2012

Confusion with SQL Server database data types

I trust you'll bear with an SQL Server newbie with what may seem a rather inane request. I am designing a web app in Web Designer 2005 Express with SQL Server Express. Unfortunately, I'm finding a little confusing with some of the data types when designing tables. I have tried to find information on the various Microsoft sites (general site, MSDN, here) and while I found one document that had a table comparing data types in different implementations of SQL, it wasn't at all helpful. Most of my confusion is with the various string and char types; the numeric types seem pretty straight forward for the most part. However, it might be helpful to know the difference between money and smallmoney/datetime and smalldatetime, particularly space/size information and formatting options (unless the latter is up to the interface). It would also be helpful to know which string/char types correspond to any counterparts they might have in, for instance, Access (with which I am already quite exprienced). Or any particular quirks or idiosyncracies they might have. I don't expect anyone to write a full tutorial, but if someone could point me in the direction of a good online doc, it would be most appreciated. You might well ask, why not use Access databases? I would answer...I like to learn new stuff!

Thanks much.

Hi Eyetech... I agree, there seem to be lots of data types to chose from. Sorry, I cant do a case study on them all for you as I too am a relative newbie... I can share one experience though... I found a key difference between the nchar and vchar types. It seems the nchar forces the lenth of the data stored to be whatever length the field is declared as - padding with spaces when needed. I found all those padding spaces to be a real pain in my code... I've since moved away from nchar in favor of vchar. I suppose there may be some performance issues there, but so far the code's a lot more friendly. -- Curt

|||

curtisdehaven:

I found a key difference between the nchar and vchar types. It seems the nchar forces the lenth of the data stored to be whatever length the field is declared as - padding with spaces when needed. I found all those padding spaces to be a real pain in my code... I've since moved away from nchar in favor of vchar.

Thanks Curtis. Since my first post, I did some Googleing and found some very helpful information on a third-party website. It includes a table with the actual numeric ranges for numeric types (eg: int: integer data from -2^31 through 2^31-1 stored in 4 bytes). It also explains something that may be the cause of your woes in using nchar type. nchar is actually for storing unicode char data which uses 2 bytes instead of 1 for each character. char supports the 1-byte ASCII characters padded to fixed lengths while varchar is the variable length type. It is recommended that if you don't actually have to store unicode, avoid using the 'n' types and stick to char/varchar. It will certainly take up less space in your database in the long run since nchar and nvarchar will always take up double the space of their char/varchar counterparts.

Being new here, I'm not sure if it is appropriate to post links to outside sources. If someone can confirm that it is ok, I'll gladly add the link for others to refer to.

|||

Hi eyetech,

Yes, you can post links to outside resource. Thank you for sharing your knowlege with all the people here.

|||

The .NET Char is the nineth integer and Unicode by default so when you are using database Char/Varchar you are using bytes until 255, the reason Membership data types are Nvarchar instead of Varchars. The SQL Server team have prepared a comprehensive chart of the three type your application uses SQL Server, ADO.NET and FCL(framework class library). Hope this helps

http://msdn2.microsoft.com/en-us/library/ms131092.aspx

SQL Server data type

CLR data type (SQL Server)

CLR data type (.NET Framework)

varbinary

SqlBytes, SqlBinary

Byte[]

binary

SqlBytes, SqlBinary

Byte[]

varbinary(1), binary(1)

SqlBytes, SqlBinary

byte, Byte[]

image

None

None

varchar

None

None

char

None

None

nvarchar(1), nchar(1)

SqlChars, SqlString

Char, String, Char[]

nvarchar

SqlChars, SqlString

SQLChars is a better match for data transfer and access, andSQLString is a better match for performing String operations.

String, Char[]

nchar

SqlChars, SqlString

String, Char[]

text

None

None

ntext

None

None

uniqueidentifier

SqlGuid

Guid

rowversion

None

Byte[]

bit

SqlBoolean

Boolean

tinyint

SqlByte

Byte

smallint

SqlInt16

Int16

int

SqlInt32

Int32

bigint

SqlInt64

Int64

smallmoney

SqlMoney

Decimal

money

SqlMoney

Decimal

numeric

SqlDecimal

Decimal

decimal

SqlDecimal

Decimal

real

SqlSingle

Single

float

SqlDouble

Double

smalldatetime

SqlDateTime

DateTime

datetime

SqlDateTime

DateTime

sql_variant

None

Object

User-defined type(UDT)

None

Same class that is bound to the user-defined type in the same assembly or a dependent assembly.

table

None

None

cursor

None

None

timestamp

None

None

xml

SqlXml

None

Saturday, 25 February 2012

Confused about dbo

I recently signed up with a web hosting company. The hosting package
included a Microsoft SQL server database with it.
Anyway here is my question. I know for sure that I am not the owner of the
database (dbo) because hosting companies don't allow their customer to
create their own databases, so why is it that when I create a table the
owner of the table shows up as dbo? I would think that the owner should be
my user name right?
Why is this happening?
Thanks for your help.What does running the following in your database return
select current_user
It sounds like you are the database owner (your login has been mapped to the
dbo user in the database) since if you were simply a member of the db_owner
role you would indeed have to prefic objects with dbo when creating them.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"msnews.microsoft.com" <Rene> wrote in message
news:eDSuZ9oqFHA.3540@.TK2MSFTNGP14.phx.gbl...
>I recently signed up with a web hosting company. The hosting package
>included a Microsoft SQL server database with it.
> Anyway here is my question. I know for sure that I am not the owner of the
> database (dbo) because hosting companies don't allow their customer to
> create their own databases, so why is it that when I create a table the
> owner of the table shows up as dbo? I would think that the owner should be
> my user name right?
> Why is this happening?
> Thanks for your help.
>|||Hey Japer:
Well, I am away from the computer that has access to the database so I can't
run the "select current_user" function right now, however, isn't me being
the dbo a bad thing from the point of view of the hosting company?
Wouldn't I be able to do things such as increase my database space or screw
some other things up by me being a dbo? Especially since my database is on a
shared SQL server?
Thanks
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:%23VFQqKpqFHA.3540@.TK2MSFTNGP14.phx.gbl...
> What does running the following in your database return
> select current_user
> It sounds like you are the database owner (your login has been mapped to
> the dbo user in the database) since if you were simply a member of the
> db_owner role you would indeed have to prefic objects with dbo when
> creating them.
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "msnews.microsoft.com" <Rene> wrote in message
> news:eDSuZ9oqFHA.3540@.TK2MSFTNGP14.phx.gbl...
>|||Jasper
Make sure you understand the difference between login names and user names.
Please read about them in the Books Online.
A login name is how you get access to SQL Server. Your login name is then
mapped to a user name in a particular database, to give you access to that
database within a SQL Server instance.
There are several ways you could have the username dbo. One is if you are
the true owner of the database. Another way is if you are in the sysadmin
server role. From your description, it sounds like this is not the case, as
that would give you WAY too much power.
A third way to have the username dbo is that your login name might be
aliased to the username dbo, which means you are not the real owner, but
within the database, you have all the privileges of the owner. A user
aliased to the dbo cannot do things outside the db, like increasing its
size.
In addition to current_user, you can also do the following:
sp_helpdb <name of db>
This will tell you who is the true owner of the db. Also
SELECT suser_sname()
will tell you what your login name is.
HTH
Kalen Delaney
www.SolidQualityLearning.com
<Rene> wrote in message news:uFPwhTpqFHA.3604@.tk2msftngp13.phx.gbl...
> Hey Japer:
> Well, I am away from the computer that has access to the database so I
> can't run the "select current_user" function right now, however, isn't me
> being the dbo a bad thing from the point of view of the hosting company?
> Wouldn't I be able to do things such as increase my database space or
> screw some other things up by me being a dbo? Especially since my database
> is on a shared SQL server?
> Thanks
>
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:%23VFQqKpqFHA.3540@.TK2MSFTNGP14.phx.gbl...
>|||Well, it turns out that the owner of the database is a user called
"dbcreator" which looks like is a predefine server role.
I am still kind of lost about this dbo:
1) You said "A third way to have the username dbo is that your login name
might be
aliased to the username dbo". Where can I see this alias mapping? Is there
an entry on some table that I can query with this iformation?
2) Is dbo an actual user? Can you logon to the database using dbo as your
logging name?
3) I was able to go to the database properties and change the "Restrinct
file grow" amount. What does this means? Does it mean that I am half dbo and
half restricted user?
Thanks
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OhE0HsqqFHA.4012@.TK2MSFTNGP12.phx.gbl...
> Jasper
> Make sure you understand the difference between login names and user
> names. Please read about them in the Books Online.
> A login name is how you get access to SQL Server. Your login name is then
> mapped to a user name in a particular database, to give you access to that
> database within a SQL Server instance.
> There are several ways you could have the username dbo. One is if you are
> the true owner of the database. Another way is if you are in the sysadmin
> server role. From your description, it sounds like this is not the case,
> as that would give you WAY too much power.
> A third way to have the username dbo is that your login name might be
> aliased to the username dbo, which means you are not the real owner, but
> within the database, you have all the privileges of the owner. A user
> aliased to the dbo cannot do things outside the db, like increasing its
> size.
> In addition to current_user, you can also do the following:
> sp_helpdb <name of db>
> This will tell you who is the true owner of the db. Also
> SELECT suser_sname()
> will tell you what your login name is.
> HTH
> Kalen Delaney
> www.SolidQualityLearning.com
> <Rene> wrote in message news:uFPwhTpqFHA.3604@.tk2msftngp13.phx.gbl...
>|||Well, I just learned something: Don't uncheck yourself out of the "db_owner"
permission or you will be doomed. I think that answers question "1", that
must be the way you alias your ID to the dbo ID and that explains why the
tables were created as dbo right?
Funny though, stored procedures are not created by default with dbo as the
owner, they are created using my user name...mmmm
Now lets figure out questions 2 and 3!
"Rene" <nospam@.nospam.com> wrote in message
news:uPwok7qqFHA.1032@.TK2MSFTNGP12.phx.gbl...
> Well, it turns out that the owner of the database is a user called
> "dbcreator" which looks like is a predefine server role.
> I am still kind of lost about this dbo:
> 1) You said "A third way to have the username dbo is that your login name
> might be
> aliased to the username dbo". Where can I see this alias mapping? Is there
> an entry on some table that I can query with this iformation?
> 2) Is dbo an actual user? Can you logon to the database using dbo as your
> logging name?
> 3) I was able to go to the database properties and change the "Restrinct
> file grow" amount. What does this means? Does it mean that I am half dbo
> and half restricted user?
> Thanks
>
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:OhE0HsqqFHA.4012@.TK2MSFTNGP12.phx.gbl...
>|||I am perfectly clear about the distinction but maybe I didn't convey it too
well in my response (although it makes sense to me) :-)
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:OhE0HsqqFHA.4012@.TK2MSFTNGP12.phx.gbl...
> Jasper
> Make sure you understand the difference between login names and user
> names. Please read about them in the Books Online.
> A login name is how you get access to SQL Server. Your login name is then
> mapped to a user name in a particular database, to give you access to that
> database within a SQL Server instance.
> There are several ways you could have the username dbo. One is if you are
> the true owner of the database. Another way is if you are in the sysadmin
> server role. From your description, it sounds like this is not the case,
> as that would give you WAY too much power.
> A third way to have the username dbo is that your login name might be
> aliased to the username dbo, which means you are not the real owner, but
> within the database, you have all the privileges of the owner. A user
> aliased to the dbo cannot do things outside the db, like increasing its
> size.
> In addition to current_user, you can also do the following:
> sp_helpdb <name of db>
> This will tell you who is the true owner of the db. Also
> SELECT suser_sname()
> will tell you what your login name is.
> HTH
> Kalen Delaney
> www.SolidQualityLearning.com
> <Rene> wrote in message news:uFPwhTpqFHA.3604@.tk2msftngp13.phx.gbl...
>|||Rene,
Did you create the table using Enterprise Manager ? If so this would explain
it. From the subsequent information it is clear that you are (or were until
you removed yourself!) a member of the db_owner role in the database and are
neither the explicit database owner or aliased to the dbo user. Being a
member of the db_owner role does not mean you are aliased to the dbo user.
It also doesn't mean that objects you created will be owned by dbo however
when a member of the db_owner database role creates a table using Enterprise
Manager then it will be owned by dbo (which is slightly odd behaviour and
does not happen if you create a table in Query Analyzer without explicitly
specifying the owner)
1) Run exec sp_helpuser in the database. This will show up any aliases added
via sp_addalias as well as the list of database users and their associated
logins.
2) dbo is a special builtin user in every database and has implied
permissions to perform any action within that database. It cannot be
removed. When you connect to SQL Server you do so using a login (e.g. fred).
A login is used to control access to a SQL Server instance. To subsequently
access a database (ignoring system databases for the purposes of this
example) that login needs to be granted access to the database. The process
of granting access to a database via sp_adduser or sp_grantdbaccess creates
a user in the database mapped to your login. Whilst it is common for the
user name within the database to match the login, this is not required (for
example your login fred could be granted access to the database with a user
name of freduser). Another way of granting access (although not recommended)
is to use sp_addalias in which case your login is mapped to an existing user
in the database. So to answer the question <g> no you cannot login to SQL
Server using dbo because it is a database user not a login.
3) No it means you are a member of the db_owner role in the database.
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Rene" <nospam@.nospam.com> wrote in message
news:%23U7KKarqFHA.4076@.tk2msftngp13.phx.gbl...
> Well, I just learned something: Don't uncheck yourself out of the
> "db_owner" permission or you will be doomed. I think that answers question
> "1", that must be the way you alias your ID to the dbo ID and that
> explains why the tables were created as dbo right?
>
> Funny though, stored procedures are not created by default with dbo as the
> owner, they are created using my user name...mmmm
> Now lets figure out questions 2 and 3!
>
> "Rene" <nospam@.nospam.com> wrote in message
> news:uPwok7qqFHA.1032@.TK2MSFTNGP12.phx.gbl...
>|||Thanks Jasper
This ownership thing is just driving me crazy! I obviously need to do some
reading on the subject. For now at least I got the thing working.

This is the type of behavior that confuses everybody. My first instinct was
to thing that I should not have permissions to the table because is not mine
but I guess that users that belong to the db_owner group can do anything on
the database no matter who created the objects.
Oh well, I will definitely doing some research about it.
Thanks for your help.
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OMM2cFyqFHA.2876@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Rene,
> Did you create the table using Enterprise Manager ? If so this would
> explain it. From the subsequent information it is clear that you are (or
> were until you removed yourself!) a member of the db_owner role in the
> database and are neither the explicit database owner or aliased to the dbo
> user. Being a member of the db_owner role does not mean you are aliased to
> the dbo user. It also doesn't mean that objects you created will be owned
> by dbo however when a member of the db_owner database role creates a table
> using Enterprise Manager then it will be owned by dbo (which is slightly
> odd behaviour and does not happen if you create a table in Query Analyzer
> without explicitly specifying the owner)
> 1) Run exec sp_helpuser in the database. This will show up any aliases
> added via sp_addalias as well as the list of database users and their
> associated logins.
> 2) dbo is a special builtin user in every database and has implied
> permissions to perform any action within that database. It cannot be
> removed. When you connect to SQL Server you do so using a login (e.g.
> fred). A login is used to control access to a SQL Server instance. To
> subsequently access a database (ignoring system databases for the purposes
> of this example) that login needs to be granted access to the database.
> The process of granting access to a database via sp_adduser or
> sp_grantdbaccess creates a user in the database mapped to your login.
> Whilst it is common for the user name within the database to match the
> login, this is not required (for example your login fred could be granted
> access to the database with a user name of freduser). Another way of
> granting access (although not recommended) is to use sp_addalias in which
> case your login is mapped to an existing user in the database. So to
> answer the question <g> no you cannot login to SQL Server using dbo
> because it is a database user not a login.
> 3) No it means you are a member of the db_owner role in the database.
>
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Rene" <nospam@.nospam.com> wrote in message
> news:%23U7KKarqFHA.4076@.tk2msftngp13.phx.gbl...
>

Friday, 24 February 2012

Conflict Management

Hi,

I developed an ppc application, where i am using web service for synchronisation, but here i am getting lot of problem while handling conflict management.

Please suggest me how to manage conflicts, using web service.

Thank you,

Prashant

Perhaps the easiest way to ensure that the unit of work that each mobile client is performing is guaranteed unique and avoid conflicts at synch time is to assign each data row a uniqueidentifier or GUID as it's PK and introduce the concept of a last changed datetime so that any changes to a unique data row from more that one mobile user can be applied on the server in the proper chronological order. Even this approach will break down in some synchronization scenarios, so web services are really best when data that needs to be operated on by mobile users can be strongly partitioned from other users or server-side changes to the data while on device.

-Darren

|||

Hi,

Thanks Darren for your reply,

I want to validate on column level of conflicts, i have given each row a different guid, but column was conflicts i am not able to handle.

Please suggest me.

|||

it's pretty hard to implement your own column level tracking of a single row that can be in multiple states across a population of mobile users. Merge replication uses 3 GUID columns, logic in the Server Agent, and tracking in the Distribution database to pull this off. I guess what I would do is get your web service synch algorithm down to working well with row-level changes and then try to eliminate scenarios where conflicts can occur. You may have to maintain some metadata about "who-pulled-what" on the server to do this. If your problem domain is such that more than one mobile user can pull the same row, you allow any or all of them to change that row (and perhaps the row is changing on the server as well), then you are biting off a pretty complex software engineering challenge to prevent the possibility of conflicts using web service synch. Start out simple and try to eliminate the scenarios where conflicts can occur by strongly partitioning data as much as possible. Column level tracking is nice in that it reduces the amount of data that has to be sent back and forth, but I wouldn't bite that off until you have a simple PutUpdates and GetUpdates working at the table and row level.

-Darren

Sunday, 19 February 2012

configuring user security problem!

Hi,
I am new to sql reporting services. I have just installed sql
reporting service sp1. We have our own web app which uses forms
authentication. I have a page where i use reportviewer control (which
came along with samples)...to run a report...there is a separate
physical report server and on that server, for the Reports virtual
directory i have "anonymous access" set. Within this i have set domain
user and password! Now microsot recommends to use "integrated windows
authentication". But as soon as i set it, my web page gives me report
server error that access is denied. I understand that my web page is
impersonating as local\ASPNET user.
I am very confused! can you help me?
I will really appreciate it
Thanks,
SauminIf you use forms authentication you have to create an extension to implement
it. You need to read up on how to do so if you need this capability. It
requires some effort on your part and it requires enterprise edition. I
suggest that you remove anonymous access for now (so you can learn how to
write a report etc and then implement form based security later). For now,
use integrated security (anonymous access and integrated security is
mutually exclusive). To supplement the info on security in the bol I suggest
this link from Scott Allen:
http://odetocode.com/Articles/215.aspx
Bruce L-C
"Saumin" <saumin_patel@.hotmail.com> wrote in message
news:35be972d.0408171307.3e2d9cab@.posting.google.com...
> Hi,
> I am new to sql reporting services. I have just installed sql
> reporting service sp1. We have our own web app which uses forms
> authentication. I have a page where i use reportviewer control (which
> came along with samples)...to run a report...there is a separate
> physical report server and on that server, for the Reports virtual
> directory i have "anonymous access" set. Within this i have set domain
> user and password! Now microsot recommends to use "integrated windows
> authentication". But as soon as i set it, my web page gives me report
> server error that access is denied. I understand that my web page is
> impersonating as local\ASPNET user.
> I am very confused! can you help me?
> I will really appreciate it
> Thanks,
> Saumin

Friday, 17 February 2012

configuring SQLDataSource with default database

Hello,

I have specified a default database in my web.config like this:

<dataConfigurationdefaultDatabase="scsLocal"/>

<connectionStrings>

<addname="scsLocal"connectionString="server=DRLSWARTEBRV;database=SCS;uid=******;password=******;"providerName="System.Data.SqlClient"/>

</connectionStrings>

Now I would like to configure a SQLDataSource control to use this default database, yet it prompts me for a connectionstring. I know I can program it in the code behind file (if I ommit connection string, it will use the default), but then I can make no use of the wizard for configuring the SQLDataSource which would safe me a lot of coding.

Is there a way to configure the SQLDataSource to use the default database that is specified in the web.config?

Thanks!

Veerle

Veerle:

<dataConfigurationdefaultDatabase="scsLocal"/>

I'm not sure about what you're trying to do with this but you can configure the SQLDataSource in your .aspx page like this:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:<the web.config parameter name>%>"
SelectCommand="You select query here"
<SelectParameters>
<if any>
</SelectParameters>
</asp:SqlDataSource>


Hope this will help.

Configuring SqlDataSource at runtime

In a web site the user has to choose one out of several sql tables to deal with.

He will then be allowed to view the selected table data through a GridView, to insert a new row into and to update a row in the selected table by means of an array of TextBoxes created dynamically on the base of the selected table.

I think it is possible to solve the problem fully by properly configuring at run time an SqlDataSource.

I have solved the issue of data display by declaring in the code behind within the OnPageLoad sub the following:

SqlDataSource1.SelectCommand ="Select * FROM " & selectedTable

While for the GridView1 I have added the selected table columns to the columns collection as follows:

for i=0 to ColumnCount-1

Dim cacAs BoundField =New BoundField

cac.HeaderText = HeaderNamesArray(i)

cac.DataField = ProductNamesArray(i)

Me.GridView1.Columns.Add(cac)

next

I have difficulty on how to do similar declarations for the insertcommand and update command.

Update and Insert are a bit more tricky. Essentially you have to build the statement including all of the table fields.

Insert Into(Field1, Field2, etc) Values(Value1, Value2, etc)

You can get the field names from the .Columns collection on a dataset, but you'll also need the datatype for the field, since you'll have to delimit string values with single quotes.

Update involves on additional issue in that you have to know the primary key...

Update Table Set Field1=Value1, etc Where PK=PKValue of row that you are on.

In short you've got your work cut out for yourself, but it can be done.

Good luck.

|||

Ciao Alex

I understand that it is too complicated to go the way I thought feasible.

I will have to accept to use a DetailsView control which is not the best graphical solution for my application.

Thanks for your concrete help

federico

Sunday, 12 February 2012

Configure Web syncronization using RMO or T-Sql

Hi
I have created merge publication using RMO programming on Sql Server
2005 and it will subscribe by Sql Server Mobile Edition.
Publication created successfully and wok fine but I have to Configure
Web synchronization manually instead of RMO programming. (In short
Configuring IIS for web synchronization).
So please any body have idea how to configure IIS for subscription
using RMO programming or any other way except manually follows the
step of configure web synchronization wizard.
Regards
Prakash
You can't. It involves creating a virtual directory, setting the correct
configuration for this (application pool, directory security, etc), putting
the isapi filter in place.
You can use ADSI for some of this, but not RMO or tsql.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"prakash" <patelprakashp@.gmail.com> wrote in message
news:1185804118.102611.31680@.i38g2000prf.googlegro ups.com...
> Hi
> I have created merge publication using RMO programming on Sql Server
> 2005 and it will subscribe by Sql Server Mobile Edition.
> Publication created successfully and wok fine but I have to Configure
> Web synchronization manually instead of RMO programming. (In short
> Configuring IIS for web synchronization).
> So please any body have idea how to configure IIS for subscription
> using RMO programming or any other way except manually follows the
> step of configure web synchronization wizard.
> Regards
> Prakash
>
|||On Aug 1, 5:43 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:[vbcol=seagreen]
> You can't. It involves creating a virtual directory, setting the correct
> configuration for this (application pool, directory security, etc), putting
> the isapi filter in place.
> You can use ADSI for some of this, but not RMO or tsql.
> --
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com"prakash" <patelpraka...@.gmail.com> wrote in message
> news:1185804118.102611.31680@.i38g2000prf.googlegro ups.com...
>
>
Thanks a lots

Configure web synchronization wizard error

I am trying to confugure SQL Server 2005 (wrokgroup edition) for merge
replication with web synchronisation. The server will be publisher and
distributor and the remote client will be running SQL Server 2005
Express.
I have set up two directories under Inetpub on the server. The access
directory is set up as a virtual directory for web access and the
snapshot directory is set up as a network share.
I have set up a local account for replication / synchronization.
The SQL Agent runs under the admin account, I have logged on to SQL
management studio under the admin account and created the publication.
When I run the configure web synchronisation wizard I keep getting an
error occuring when it gets to the step "Setting the snapshot share
permissions" which then rolls back the previous actions.
A message comes up for each user I have specified (three in the last
case) saying "Setting the snapshot share permissions (error)" and then
"The operation completed successfully. (Exception from HRESULT:
0x8007) (mscorlib)" for each user.
I have tried manually configuring both directories for permissions for
all three accounts (admin account running SQL agent, local account for
replication/synchronisationand login on remote client). Starting to
clutch at straws!
Any help greatly appreciated. It appears to be something to do with
permissions but I am not sure what to set for which account and where.
Many thanks.
On 1 Jun, 10:37, JDS <a...@.jeremysage.com> wrote:
> I am trying to confugure SQL Server 2005 (wrokgroup edition) for merge
> replication with web synchronisation. The server will be publisher and
> distributor and the remote client will be running SQL Server 2005
> Express.
>...
> A message comes up for each user I have specified (three in the last
> case) saying "Setting the snapshot share permissions (error)" and then
> "The operation completed successfully. (Exception from HRESULT:
> 0x8007) (mscorlib)" for each user.
>
I think problem solved but just in case anyone else comes across the
same thing (I have seen a few similar post with no resolution) the
change that seemed to make the difference was the specification of the
location of the snapshot folder. I clicked on the "Browse..." button
to specify the location but this does not seem to insert the correct
reference - it gives the full path - I changed this to //ServerName/
ShareName and the wizard complete OK.
I hope this was of use to someone.

Friday, 10 February 2012

configure web synchronization pb

hi,

First, sorry for my english, I'm french

When i try to configure web synchronization, I get the following err " success Hresult 0x8007000"(!!!) for the step : setting the snapshot share permission

I really don't understand : my folder have all the rights for the user agent...

I don't know what to do.

Config . SQL Server SP4,Microsoft SQL Server 2005 Mobile Edition

It had worked but I had to reinstall the system and now, it does not work anymore

Thans for your help,

Eric

does the account which the snapshot agent runs under have the following rights on this share and its underlying files and folders.

List files and folders

Write

|||thank you for your help but I'm sorry for the answer
the agent have the rights as wall as its folders

I work now (i thought it wouls be better) with sql server 2005 (sqlexpress)
but it's the same

I spent 2 days on it and I don't really know what to do now...

Please ........|||is there a way to do it manually ?|||

I assume that the merge agent is running from a different machine.

1. Does the above error happen on the initial sync?

2. Do you use SQL Agent job to do the sync? If so then can you try to run replmerg.exe from the command line and see if that works, for web sync? If web sync does not work, can you try the fully connected mode (just remove the internet related parameters from the command line)?

3. Can you also try to do https://Your_iis_server_address/the_web_sync_folder/replisapi.dll from IE?

|||1) No, I'm not able to configure it (the error occurs when I try to configure the replication, so I'm not able to sync

2) yes

3) I use sqlcesa30.dll

I'm not sure I understood what you wanted me to do.|||I'm sorry to post a new message but I have a demonstration at the end of the week and I don't have solved the problem.
Can anyone help me ? (I can let my msn adress if necessary)|||

Hresult 0x8007000 maybe either access issue or out of memory.

Can you try:

1. with a different account (running the wizard and account for which you want to grant the permissions)

2. reboot the server

|||1- does not work
2 - does not work

This replication is for sql server 2005 Mobile edition

Does the account have to be part of particular groups?|||

Are you using a domain user?

If you could post your steps in detail, I can try to help.

|||

Are you using the "configure web synchronization wizard" ? have you follow the instruction in SQL server 2005 mobile edtion Book online, session "How to: Configure Connectivity with the Configure Web Synchronization Wizard "?

Thanks

Yunwen

|||First of all, thanks again for you help

I have created the snapshot replication folder. I effectively use a domain user for the rights on the
this folder.(r&w fro the folder and r&w and execute for the share)
The creation of the replication is ok using sql server 2005
I give the user agent the same user that the snaphot folder
I launch the config wizard. Everything is ok until the step "setting snapshot folder permission"
I don't know if you can help me "live" using msn but if so let me know and I will give you my address.|||Yes I did|||

What snapshot location do you give in the wizard?

|||The snapshot location si the following : \\servername\Folder1\Folder2 which contains unc forlder from the replication

Configure SQL Server on Web Server!!

I recently have configured a web server based on Windows 2003 Server and IIS 5. I'd installed SQL Server 2005 on to it. I want this SQL server to be accessiable to my clients for their data storage purpose. I want to configure this sql server accessiable to them through a DNS name. My domain name is www.talons.com.np. How can i do this? I need your all kind support in this regard.

It is not clear what your clients are going to use to access the server.
Could you clarify your plans?|||

Please do not double post. As indicated in the other post, if you want them connect to the SQL Server machine by DNS name, you can configure a port redirection on your outside router to route the incoming connections on port 1433 to the SQL Server.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Configure SQL Server 2000 on Web Server accessible to client!!

I recently have configured my Web Server based on Windows 2003 Server and IIS 5x. I'd also installed SQL Server 2005 into this. Now I want toc onfigure this SQL Server, so that my client can access their database through a DNS name. I request you all for your kind support in this regard. Thanks in advance.

Datbased are not access by DNS Name. Default instances of server are accessed through DNS Names. Using the syntax for the default server e.g. Computername or for a named instance ComputerName\InstanceName should do the trick. If you want to reach the instances by just a name, without the \ within the name, you will have to configure an alias for them on each client machine.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Configure SQL Server 2000 on a Web Server accessible to client!!

I have recently configured a Web Server based on Windows 2003 Server and IIS 5x. I'd also installed SQL Server 2005 into this. Now I want toc onfigure this SQL Server, so that my client can access their database through a DNS name. I request you all for your kind support in this regard. Thanks in advance.

PLease do not double post, see the answer in (one of your) other threads.

Jens K. Suessmeyer

http://www.sqlserver2005.de

Configure Reporting Services

Specs
Server 2000, IIS5, .Net 2, .Net 1.1, SQL Server 2005 Developers Edition
Unable to set Web Service Identity
Web Service Identity is blank, have set
rsreportserver.config to include
<WebServiceAccount>ASPNET</WebServiceAccount>
Also tried
<WebServiceAccount>./ASPNET</WebServiceAccount>
but none seem to work?
The service is inistialized, but I cannont go to /reports or /reportmanager
when I apply on the blank entry in theReporting Services configration, I
receive this error:
ReportServicesConfigUI.WMIProvider.WMIProviderException: An unknown error
has occurred in the WMI Provider. Error Code 80070005
at
ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.SetWebServiceIdentity(String applicationPool)
please helpFacing the same problem. I've the same configuration and got same error. any
luck?
"GregCrossan" wrote:
> Specs
> Server 2000, IIS5, .Net 2, .Net 1.1, SQL Server 2005 Developers Edition
> Unable to set Web Service Identity
> Web Service Identity is blank, have set
> rsreportserver.config to include
> <WebServiceAccount>ASPNET</WebServiceAccount>
> Also tried
> <WebServiceAccount>./ASPNET</WebServiceAccount>
> but none seem to work?
> The service is inistialized, but I cannont go to /reports or /reportmanager
> when I apply on the blank entry in theReporting Services configration, I
> receive this error:
> ReportServicesConfigUI.WMIProvider.WMIProviderException: An unknown error
> has occurred in the WMI Provider. Error Code 80070005
> at
> ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.SetWebServiceIdentity(String applicationPool)
>
> please help|||Make that three of us.
I've tried:
uninstalling & reinstalling IIS,
reconfiguring Reporting Services,
re-registering asp.net
(C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i)
Any suggestions?
--
Clayton
"samjay" wrote:
> Facing the same problem. I've the same configuration and got same error. any
> luck?
> "GregCrossan" wrote:
> > Specs
> > Server 2000, IIS5, .Net 2, .Net 1.1, SQL Server 2005 Developers Edition
> >
> > Unable to set Web Service Identity
> >
> > Web Service Identity is blank, have set
> > rsreportserver.config to include
> > <WebServiceAccount>ASPNET</WebServiceAccount>
> > Also tried
> > <WebServiceAccount>./ASPNET</WebServiceAccount>
> >
> > but none seem to work?
> >
> > The service is inistialized, but I cannont go to /reports or /reportmanager
> >
> > when I apply on the blank entry in theReporting Services configration, I
> > receive this error:
> > ReportServicesConfigUI.WMIProvider.WMIProviderException: An unknown error
> > has occurred in the WMI Provider. Error Code 80070005
> > at
> > ReportServicesConfigUI.WMIProvider.RSReportServerAdmin.SetWebServiceIdentity(String applicationPool)
> >
> >
> >
> > please help|||Hey all, just curious if any of you got this figured out. We all seem
to have the same problem.
Chris

Configure Report Server Initialization Problem (SQL 2005) Seeking for expert

I setup Report Server Virtual Directory, Report Manager Virtual Directory,
Windows Service identity, Web service identity, database setup, they all
working fine. When I click on [Inititialization] I get this error
----
Reporting Services Configuration Manager
--
There was an error while switching panels. The most likely cause is an error
retrieving WMI properties. The exception details are:
An error occurred when attempting to connect to the report server remote
procedure call (RPC) end point. Verify that the Report Server Windows
service is running, and then retry the operation.
Details:
The RPC server is not listening. (Exception from HRESULT: 0x800706B3)
-----
Experts, please help me out, I'm stuck. Thank you very much!Server Status and Initialization has (x) on it, should initiazation solve
first or make server running first?
"news.microsoft.com" <Astroboy@.hotmail.com> wrote in message
news:%23oixTfCgGHA.4304@.TK2MSFTNGP05.phx.gbl...
>I setup Report Server Virtual Directory, Report Manager Virtual Directory,
>Windows Service identity, Web service identity, database setup, they all
>working fine. When I click on [Inititialization] I get this error
> ----
> Reporting Services Configuration Manager
> --
> There was an error while switching panels. The most likely cause is an
> error retrieving WMI properties. The exception details are:
> An error occurred when attempting to connect to the report server remote
> procedure call (RPC) end point. Verify that the Report Server Windows
> service is running, and then retry the operation.
> Details:
> The RPC server is not listening. (Exception from HRESULT: 0x800706B3)
> -----
> Experts, please help me out, I'm stuck. Thank you very much!
>