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

Thursday, March 29, 2012

adding a stored proc to a publication

Hi

I created a publication (merge anonymous via Web) - the subscriber already had the data, so there was no need to to initialize data and schema.

The problem is when it comes to adding a new stored proc to the publication. I create the proc, add it as an article to the publication and recreate the snapshot ok, but then the synchronisation fails. I presume this is because the stored proc does not exist at the subscriber. I bet it would work if I had initialized the schema and data, but due to the size of the data this is not practical.

If I manually create the proc at the subscriber then it works fine - but this defeats the purpose somewhat.....

Any ideas ?

thanks
BruceSince the subscription was created as no-sync, you will need to manually create the proc on the subscriber. You could create different publications for tables and stored procs and workaround that way. Now you can initialize the subscriber for the publication with the stored proc (and other smaller articles if you wish) and large data publication can stay intact (as no-sync)|||Thanks for the suggestion - a good workaround for now....

Adding a step to CreateUserWizard

Hey all,

I'm working in Visual Web Developer 2005 Express. I'm a total newb so please bare with me. I'm trying to add a step to my CreateUserWizard that I put in using the automatic site administration utility. I've added a wizard step in between the "Sign up for your new account" step and the "complete" step. The purpose of the new step is to collect additional information about the user. I've added a FormView control and used an SQLDataSource to link it to a new table in the database established by the administration utility, and set up the templates to recieve the data.


The one kink in the process seems to be associating the UserID created in step one with the additional information submitted in step 2. I made a UserID column, of data type uniqueidetifier in my new table and set up a foreign key relationship with the UserID columns in the aspnet_Membership table and the aspnet_Users table. When I run it as is I get the following error after I try to insert the data entered in the second step (additional information) into my new database table:

Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. Use the CONVERT function to run this query

I guess my question is:How do I take the UserID generated in step 1, and pass it into the new table and into the new row being created in step 2? If possible, I would like to do it without any code (haha probably not going to happen, but worth a shot) but any assistance anyone could offer would be greatly appreciated. Thanks everyone.

Matt Downey

You can grab the userID like this

Membership.GetUser(CreateUserWizard1.UserName).ProviderUserKey

where createuserwizard1 is the ID of the 1st step of your wizard.

Sunday, March 25, 2012

Adding a Delete functionality to my Shopping Cart

Hello,

I'm in the progress of developing a shopping cart system that operates with an SQL database in Visual Web Developer 2005. I've managed to successfully add items to the cart and display them, but I'm having trouble providing the user with the option of removing items from the cart.

My understanding so far is that I've got to adjust the DELETE SQL statement of the data source. At first I was thinking along the lines of a simple statement:

DELETE * FROM ShoppingCart WHERE CartID=@.CartID AND CategoryID=@.CategoryID AND ProductID=@.ProductID

However, I've realised that the parameters I need for this SQL query aren't automatically passed in when a user clicks the "Delete" text of the Delete field (at least I think this is the problem).

The error message which I'm getting when I try to remove an item from the cart is as follows:

Incorrect syntax near '*'.

If anyone could let me know where I'm going wrong and point me in the right direction I'd be really grateful.

Thank you,

Luke

Hi Luke,

There should not be an asterisk (*) in your DELETE statement. If you remove that you might have better luck.|||

Thanks very much for your help - I thought it might have been a really stupid mistake like that! Anyway everything is working fine now.

Thanks again,

Luke

Tuesday, March 20, 2012

Added a column to my SQL database and now text field will not write to it. Why

I have a web form that is an interface for a database. The code was working fine until a field needed to be added. So I added the new field, updated the data adapter and data set, and when i enter the data into the field, all of the old fields are getting updated, but the new ones aren't. I am at wits end as to why. Can someone please help!!!

I am using VS Studio 2000 ASP.NET and C#. The code is below. The bold items are the new fields.

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

namespace TrafficDept

{

///<summary>

/// Summary description for AddOwner.

///</summary>

publicclass AddOwner : System.Web.UI.Page

{

protected System.Web.UI.WebControls.Button Button1;

protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3;

protected System.Data.SqlClient.SqlConnection sqlConnection1;

protected System.Web.UI.WebControls.TextBox TextBox1;

protected System.Web.UI.WebControls.TextBox TextBox2;

protected System.Data.SqlClient.SqlDataAdapter daAddOwner;

protected System.Web.UI.WebControls.TextBox tbOtherOwnerLName;

protected System.Web.UI.WebControls.Panel namePanel;

protected System.Web.UI.WebControls.TextBox tbOtherOwnerMI;

protected System.Web.UI.WebControls.TextBox tbOtherOwnerFName;

protected System.Web.UI.WebControls.TextBox tbSecondOwnerLName;

protected System.Web.UI.WebControls.TextBox tbSecondOwnerMI;

protected System.Web.UI.WebControls.TextBox tbSecondOwnerFName;

protected System.Web.UI.WebControls.Button Button4;

protected SiteCubed.EditWorksProfessional tbNote;

protected System.Web.UI.WebControls.Panel notePanel;

protected System.Web.UI.WebControls.DropDownList ddlStatus;

protected PeterBlum.PetersDatePackage.DateTextBox tbRegDate;

protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;

protected System.Web.UI.WebControls.TextBox tbOwner;

protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;

protected System.Web.UI.WebControls.TextBox tbOwnerMI;

protected System.Web.UI.WebControls.TextBox tbOwnerLName;

protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;

protected System.Web.UI.WebControls.TextBox tbBusinessName;

protected System.Web.UI.WebControls.TextBox tbAddress;

protected System.Web.UI.WebControls.TextBox tbRegNo;

protected System.Web.UI.WebControls.TextBox tbPreviousOwner;

protected System.Web.UI.WebControls.TextBox tbPOwnerAddress;

protected System.Web.UI.WebControls.TextBox tbPORegNo;

protected PeterBlum.PetersDatePackage.DateTextBox tbTransferDate;

protected System.Web.UI.WebControls.DropDownList ddlMeans;

protected System.Web.UI.WebControls.Button Button3;

protected System.Web.UI.WebControls.Button Button2;

protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;

protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;

protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;

protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;

protected TrafficDept.dsAddOwner dsAddOwner1;

privatevoid Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

}

#region Web Form Designer generated code

privatevoid Button2_Click(object sender, System.EventArgs e)

{

Response.Redirect("AddOthers.aspx");

}

privatevoid Button1_Click(object sender, System.EventArgs e)

{

daAddOwner.Fill(dsAddOwner1);

dsAddOwner.OwnershipRow drOwner = dsAddOwner1.Ownership.NewOwnershipRow();

drOwner.Plates_ID =int.Parse(Session["PlatesID"].ToString());

drOwner.Status = ddlStatus.SelectedItem.Text;

drOwner.Current_Legal_Owner = tbOwner.Text;

drOwner.Owner_CurrentLegalOwnerMI = tbOwnerMI.Text.ToString();

drOwner.Owner_CurrentLegalOwnerLName = tbOwnerLName.Text;

drOwner.Owner_CurrentBusinessName = tbBusinessName.Text;

if (!tbRegDate.xIsEmpty)

drOwner.Date_of_Registration = DateTime.Parse(tbRegDate.Text.ToString());

drOwner.Address_of_Current_Owner = tbAddress.Text;

drOwner.Reg_No_for_Current_Owner = tbRegNo.Text;

drOwner.Previous_Owner = tbPreviousOwner.Text;

drOwner.Previous_Owner_Address = tbPOwnerAddress.Text;

drOwner.Reg_No_for_Previous_Owner = tbPORegNo.Text;

if (!tbTransferDate.xIsEmpty)

drOwner.Date_of_Transfer = DateTime.Parse(tbTransferDate.Text.ToString());

drOwner.By_Means_of = ddlMeans.SelectedItem.Text;

drOwner.Owner_SecondaryLegalOwnerFName = tbSecondOwnerFName.Text;

drOwner.Owner_SecondaryLegalOwnerMI = tbSecondOwnerMI.Text;

drOwner.Owner_SecondaryLegalOwnerLName = tbSecondOwnerLName.Text;

drOwner.Owner_OtherLegalOwnerFName = tbOtherOwnerFName.Text;

drOwner.Owner_OtherLegalOwnerMI = tbOtherOwnerMI.Text;

drOwner.Owner_OtherLegalOwnerLName = tbOtherOwnerLName.Text;

drOwner.Owner_Notes = tbNote.Text;

dsAddOwner1.Ownership.Rows.Add(drOwner);

daAddOwner.Update(dsAddOwner1);

Response.Redirect("AddOthersTP.aspx");

}

privatevoid Button3_Click(object sender, System.EventArgs e)

{

//daAddOwner.Fill(dsAddOwner1);

//dsAddOwner.OwnershipRow drAddOwner = dsAddOwner1.Ownership.NewOwnershipRow();

namePanel.Visible =true;

}

privatevoid Button4_Click(object sender, System.EventArgs e)

{

notePanel.Visible =true;

}

}

}

I found my problem. The .dll was never being rebuilt.

Thursday, March 8, 2012

Add new user with web service

Hi there,
Would like to manage users (adding, deleting) and give them browsing rights
to reports programmatically, using the web service. Can't find the method
allowing me to do it anywhere.
Am I missing something ?
Cheers
ggThere are several methods depending on what you want to accomplish. Given a
user you can give them system level privledges using SetSystemPolicies() or
privledges on individual items using SetPolicies(). A policy is a mapping
of a user to a role. Roles are managed via
CreateRole()/SetRoleProperties/etc.. and define the specific privledges you
want to assign. For your purposes you might want to use the predefined
"Browser" role.
Jon Heide
SQL Server Reporting Services
----
Everything you need to know about SQL Server Reporting Services:
http://www.microsoft.com/sql/reporting/default.asp
----
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
----

Sunday, February 19, 2012

add an image to the web page

hi

u didnot get the question!

I asked I copeid an image to the app_data folder and dropdowned a image object to the web form, image--> style-->background-->background image-->select back ground image from the app_data folder , the image appear on the page but when I debug the page it donot display

Thats because you posted in the wrong forum, this is a SQL Server Express forum and depending on the rare information you gave, I assumed that you want to load the image from SQL Server and display it in a webpage. If the file is on disk you will have to provide the code you are using to do this. BTW the app_data folder is reserved for storing data not the actual res / misc files.

Jens K. Suessmeyer.

http://www.sqlserver2005.de

Thursday, February 16, 2012

Add a xml dataSource in a olap cube

Hi,
I have a question, I have ms sql data base, with lot of data, but I have to add data from a web services, may it be possible ?

The preferred way to accomplish this would be to import the web service information into a database, and then add it to your DSV to make it available to the cube. Take a look at SSIS, as it can communicate with web services, and then write the data to a database.|||SSIS will also allow you to take data from a data source (like a web service) and "push" it directly into an OLAP partition. The advantage of pushing into a relational database first is that if you ever need to do a full process of you OLAP database the data is sitting there and you will not need to hit the webservice.

Sunday, February 12, 2012

Ad hoc report with Visual Web Developer 2005 Express?

Hi. I use Visual Web Developer 2005 Express (hereafter VWD) with the
the MS Reporting Services Add-in. I've successfully created a report
using this service. But the SQL query I used was pre-defined.
I am wondering if this add-in with VWD lets us do ad hoc reports. For
example, let the end user select from a list of available fields and
set the condition criteria.
Any hint? Thx.Why to reinvent the wheel, whatever you thought of doing is already there in
Report Builder so make use of it.
Provided you have SS2005. If not possibly you can go for one.
Amarnath
"antonyliu2002@.yahoo.com" wrote:
> Hi. I use Visual Web Developer 2005 Express (hereafter VWD) with the
> the MS Reporting Services Add-in. I've successfully created a report
> using this service. But the SQL query I used was pre-defined.
> I am wondering if this add-in with VWD lets us do ad hoc reports. For
> example, let the end user select from a list of available fields and
> set the condition criteria.
> Any hint? Thx.
>

AD Domain Local Groups bug in RS ?

Hi,
I'm posting this problem for the third time. Still no answer from the MS
Team. I've found other users on the web having the same issue.
I have the following problem with AD an RS: when creating a group of users
as a "domain local group" in AD, i'm able to give a specific item-level role
in RS to members of this group. But it looks like rights are not effective
for those users. For example if the group is defined as "reader" on a folder,
group members can't see it in RS!
Everything works fine when the created group is a "global group" in AD.
Best Regards.
Greg.Hi all,
Is it a known bug ?
Thanx.
Greg.
"Greg - NEOS" wrote:
> Hi,
> I'm posting this problem for the third time. Still no answer from the MS
> Team. I've found other users on the web having the same issue.
> I have the following problem with AD an RS: when creating a group of users
> as a "domain local group" in AD, i'm able to give a specific item-level role
> in RS to members of this group. But it looks like rights are not effective
> for those users. For example if the group is defined as "reader" on a folder,
> group members can't see it in RS!
> Everything works fine when the created group is a "global group" in AD.
> Best Regards.
> Greg.
>|||Has someone already tested AD local groups in RS ?
Greg.
"Greg - NEOS" wrote:
> Hi all,
> Is it a known bug ?
> Thanx.
> Greg.
> "Greg - NEOS" wrote:
> > Hi,
> >
> > I'm posting this problem for the third time. Still no answer from the MS
> > Team. I've found other users on the web having the same issue.
> >
> > I have the following problem with AD an RS: when creating a group of users
> > as a "domain local group" in AD, i'm able to give a specific item-level role
> > in RS to members of this group. But it looks like rights are not effective
> > for those users. For example if the group is defined as "reader" on a folder,
> > group members can't see it in RS!
> >
> > Everything works fine when the created group is a "global group" in AD.
> >
> > Best Regards.
> > Greg.
> >