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

Wednesday, March 28, 2012

Parsing web URL's in SQL

Hello everyone,
I was wondering if anyone could help me out. Basically I have several
sharepoint sites for applications that I run. Each applications
sharepoint site needs to display information about the application
that is located in a SQL database. So for example:
www.qwerty.com/application1/home.html
www.qwerty.com/application2/home.html
www.qwerty.com/application3/home.html
I need to find a way that SQL, Sharepoint, some code, would take the
web address, parse, and truncate it to only read "Application1."
Then I could write a SQL statement to get the data from Application1's
database to display on the sharepoint site. However I have several
application pages, and I would like to be able to have some type of
code that would automatically do it for all the applications, instead
of manually coding/quiering for the data for each application
page.....it would just take too long.
if anyone has any ideas, feel free to share. Thank you in advance, for
all your time and help it is greatly appreciated!
--A4orce84
If the part you want is always the next to last section, then this
would appear to provide what is needed. A bit convoluted though!
CREATE TABLE Demo (url varchar(100) not null)
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
SELECT REVERSE(
SUBSTRING(REVERSE(url),
charindex('/', REVERSE(url)) +1,
charindex('/', REVERSE(url), charindex('/',
REVERSE(url)) + 1) -
charindex('/', REVERSE(url)) - 1))
FROM Demo
application1
application2
application3
banana
Roy Harvey
Beacon Falls, CT
On Fri, 08 Jun 2007 09:01:28 -0700, Asif_Ahmad@.dell.com wrote:

>Hello everyone,
>I was wondering if anyone could help me out. Basically I have several
>sharepoint sites for applications that I run. Each applications
>sharepoint site needs to display information about the application
>that is located in a SQL database. So for example:
>www.qwerty.com/application1/home.html
>www.qwerty.com/application2/home.html
>www.qwerty.com/application3/home.html
>I need to find a way that SQL, Sharepoint, some code, would take the
>web address, parse, and truncate it to only read "Application1."
>Then I could write a SQL statement to get the data from Application1's
>database to display on the sharepoint site. However I have several
>application pages, and I would like to be able to have some type of
>code that would automatically do it for all the applications, instead
>of manually coding/quiering for the data for each application
>page.....it would just take too long.
>if anyone has any ideas, feel free to share. Thank you in advance, for
>all your time and help it is greatly appreciated!
>--A4orce84
|||Ron,
Is this if you only know the number of applications you have? I think
there are several hundred I am using particularly. It also appears
from your code that you have to enter the physical address into the
code by your:
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
I wanted a way that it would do it automatically, that way if servers
change and things get moved around, or they add more applications it
would be easy to keep maintaining the SQL. Or I may have completely
mis-interpreted your code, either way thank you for your help. Any
additional information you could provide would be helpful!
|||I assumed that the URLs you needed to parse would already be in a SQL
Server database table. (Why else would you be trying to parse a URL
in SQL Server?) So my CREATE TABLE and INSERT statements were simply
there to create some test data for demonstration purposes. The number
of URLs in your table is irrelevant to the parsing process.
What I intended to demonstrate was a way to pick out the next to last
section of the URL, which was what I thought you were aiming for. I
believe the code provided does that.
Good luck!
Roy Harvey
Beacon Falls, CT
On Sun, 10 Jun 2007 15:04:14 -0700, Asif_Ahmad@.dell.com wrote:

>Ron,
>Is this if you only know the number of applications you have? I think
>there are several hundred I am using particularly. It also appears
>from your code that you have to enter the physical address into the
>code by your:
>
>INSERT Demo values ('www.qwerty.com/application1/home.html')
>INSERT Demo values ('www.qwerty.com/application2/home.html')
>INSERT Demo values ('www.qwerty.com/application3/home.html')
>INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
>
>I wanted a way that it would do it automatically, that way if servers
>change and things get moved around, or they add more applications it
>would be easy to keep maintaining the SQL. Or I may have completely
>mis-interpreted your code, either way thank you for your help. Any
>additional information you could provide would be helpful!

Parsing web URL's in SQL

Hello everyone,
I was wondering if anyone could help me out. Basically I have several
sharepoint sites for applications that I run. Each applications
sharepoint site needs to display information about the application
that is located in a SQL database. So for example:
www.qwerty.com/application1/home.html
www.qwerty.com/application2/home.html
www.qwerty.com/application3/home.html
I need to find a way that SQL, Sharepoint, some code, would take the
web address, parse, and truncate it to only read "Application1."
Then I could write a SQL statement to get the data from Application1's
database to display on the sharepoint site. However I have several
application pages, and I would like to be able to have some type of
code that would automatically do it for all the applications, instead
of manually coding/quiering for the data for each application
page.....it would just take too long.
if anyone has any ideas, feel free to share. Thank you in advance, for
all your time and help it is greatly appreciated!
--A4orce84If the part you want is always the next to last section, then this
would appear to provide what is needed. A bit convoluted though!
CREATE TABLE Demo (url varchar(100) not null)
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
SELECT REVERSE(
SUBSTRING(REVERSE(url),
charindex('/', REVERSE(url)) +1,
charindex('/', REVERSE(url), charindex('/',
REVERSE(url)) + 1) -
charindex('/', REVERSE(url)) - 1))
FROM Demo
--
application1
application2
application3
banana
Roy Harvey
Beacon Falls, CT
On Fri, 08 Jun 2007 09:01:28 -0700, Asif_Ahmad@.dell.com wrote:
>Hello everyone,
>I was wondering if anyone could help me out. Basically I have several
>sharepoint sites for applications that I run. Each applications
>sharepoint site needs to display information about the application
>that is located in a SQL database. So for example:
>www.qwerty.com/application1/home.html
>www.qwerty.com/application2/home.html
>www.qwerty.com/application3/home.html
>I need to find a way that SQL, Sharepoint, some code, would take the
>web address, parse, and truncate it to only read "Application1."
>Then I could write a SQL statement to get the data from Application1's
>database to display on the sharepoint site. However I have several
>application pages, and I would like to be able to have some type of
>code that would automatically do it for all the applications, instead
>of manually coding/quiering for the data for each application
>page.....it would just take too long.
>if anyone has any ideas, feel free to share. Thank you in advance, for
>all your time and help it is greatly appreciated!
>--A4orce84|||Ron,
Is this if you only know the number of applications you have? I think
there are several hundred I am using particularly. It also appears
from your code that you have to enter the physical address into the
code by your:
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
I wanted a way that it would do it automatically, that way if servers
change and things get moved around, or they add more applications it
would be easy to keep maintaining the SQL. Or I may have completely
mis-interpreted your code, either way thank you for your help. Any
additional information you could provide would be helpful!|||I assumed that the URLs you needed to parse would already be in a SQL
Server database table. (Why else would you be trying to parse a URL
in SQL Server?) So my CREATE TABLE and INSERT statements were simply
there to create some test data for demonstration purposes. The number
of URLs in your table is irrelevant to the parsing process.
What I intended to demonstrate was a way to pick out the next to last
section of the URL, which was what I thought you were aiming for. I
believe the code provided does that.
Good luck!
Roy Harvey
Beacon Falls, CT
On Sun, 10 Jun 2007 15:04:14 -0700, Asif_Ahmad@.dell.com wrote:
>Ron,
>Is this if you only know the number of applications you have? I think
>there are several hundred I am using particularly. It also appears
>from your code that you have to enter the physical address into the
>code by your:
>
>INSERT Demo values ('www.qwerty.com/application1/home.html')
>INSERT Demo values ('www.qwerty.com/application2/home.html')
>INSERT Demo values ('www.qwerty.com/application3/home.html')
>INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
>
>I wanted a way that it would do it automatically, that way if servers
>change and things get moved around, or they add more applications it
>would be easy to keep maintaining the SQL. Or I may have completely
>mis-interpreted your code, either way thank you for your help. Any
>additional information you could provide would be helpful!

Parsing web URL's in SQL

Hello everyone,
I was wondering if anyone could help me out. Basically I have several
sharepoint sites for applications that I run. Each applications
sharepoint site needs to display information about the application
that is located in a SQL database. So for example:
www.qwerty.com/application1/home.html
www.qwerty.com/application2/home.html
www.qwerty.com/application3/home.html
I need to find a way that SQL, Sharepoint, some code, would take the
web address, parse, and truncate it to only read "Application1."
Then I could write a SQL statement to get the data from Application1's
database to display on the sharepoint site. However I have several
application pages, and I would like to be able to have some type of
code that would automatically do it for all the applications, instead
of manually coding/quiering for the data for each application
page.....it would just take too long.
if anyone has any ideas, feel free to share. Thank you in advance, for
all your time and help it is greatly appreciated!
--A4orce84If the part you want is always the next to last section, then this
would appear to provide what is needed. A bit convoluted though!
CREATE TABLE Demo (url varchar(100) not null)
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
SELECT REVERSE(
SUBSTRING(REVERSE(url),
charindex('/', REVERSE(url)) +1,
charindex('/', REVERSE(url), charindex('/',
REVERSE(url)) + 1) -
charindex('/', REVERSE(url)) - 1))
FROM Demo
application1
application2
application3
banana
Roy Harvey
Beacon Falls, CT
On Fri, 08 Jun 2007 09:01:28 -0700, Asif_Ahmad@.dell.com wrote:

>Hello everyone,
>I was wondering if anyone could help me out. Basically I have several
>sharepoint sites for applications that I run. Each applications
>sharepoint site needs to display information about the application
>that is located in a SQL database. So for example:
>www.qwerty.com/application1/home.html
>www.qwerty.com/application2/home.html
>www.qwerty.com/application3/home.html
>I need to find a way that SQL, Sharepoint, some code, would take the
>web address, parse, and truncate it to only read "Application1."
>Then I could write a SQL statement to get the data from Application1's
>database to display on the sharepoint site. However I have several
>application pages, and I would like to be able to have some type of
>code that would automatically do it for all the applications, instead
>of manually coding/quiering for the data for each application
>page.....it would just take too long.
>if anyone has any ideas, feel free to share. Thank you in advance, for
>all your time and help it is greatly appreciated!
>--A4orce84|||Ron,
Is this if you only know the number of applications you have? I think
there are several hundred I am using particularly. It also appears
from your code that you have to enter the physical address into the
code by your:
INSERT Demo values ('www.qwerty.com/application1/home.html')
INSERT Demo values ('www.qwerty.com/application2/home.html')
INSERT Demo values ('www.qwerty.com/application3/home.html')
INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
I wanted a way that it would do it automatically, that way if servers
change and things get moved around, or they add more applications it
would be easy to keep maintaining the SQL. Or I may have completely
mis-interpreted your code, either way thank you for your help. Any
additional information you could provide would be helpful!|||I assumed that the URLs you needed to parse would already be in a SQL
Server database table. (Why else would you be trying to parse a URL
in SQL Server?) So my CREATE TABLE and INSERT statements were simply
there to create some test data for demonstration purposes. The number
of URLs in your table is irrelevant to the parsing process.
What I intended to demonstrate was a way to pick out the next to last
section of the URL, which was what I thought you were aiming for. I
believe the code provided does that.
Good luck!
Roy Harvey
Beacon Falls, CT
On Sun, 10 Jun 2007 15:04:14 -0700, Asif_Ahmad@.dell.com wrote:

>Ron,
>Is this if you only know the number of applications you have? I think
>there are several hundred I am using particularly. It also appears
>from your code that you have to enter the physical address into the
>code by your:
>
>INSERT Demo values ('www.qwerty.com/application1/home.html')
>INSERT Demo values ('www.qwerty.com/application2/home.html')
>INSERT Demo values ('www.qwerty.com/application3/home.html')
>INSERT Demo values ('www.qwerty.com/whatever/banana/987.htm')
>
>I wanted a way that it would do it automatically, that way if servers
>change and things get moved around, or they add more applications it
>would be easy to keep maintaining the SQL. Or I may have completely
>mis-interpreted your code, either way thank you for your help. Any
>additional information you could provide would be helpful!

Monday, March 26, 2012

Parent/child SQL query

Hello, I woud like to find a resource (book, web site, etc.) that
demonstrates writing queries related to parent/child relationships. In
particular I have a table that contains an unknown number of parents/childre
n
(and grand-children, great grand children, etc). I would like to create a
pivot table so that all the parents become columns and each row represents a
child (grand child, great grand child, etc.) for that parent.
Thank you,
RicOne of them is "Trees and Hierarchies" by Joe Celko. I'm sure he's just
writing a response himself. ;)
However, what you've specified in your post is best handled on the client,
as it's obviously just for presentation purposes (it breaks nromalization).
ML
http://milambda.blogspot.com/|||>> I woud like to find a resource (book, web site, etc.) that demonstrates w
riting queries related to parent/child relationships.<<
Buy a copies of TREES & HIERARCHIES IN SQL, of course! Steral the code
in the book.|||Check out the stuff Izik Ben Gan has done on trees and hierarchies.
Don't buy celko's book, its based around standard sql rather than Microsoft
SQL Server so you'll find it hard to implement, also, a lot of his methods
are slow, dont scale and out of date.
Tony Rogerson
SQL Server MVP
http://sqlserverfaq.com - free video tutorials
"Ric" <Ric@.discussions.microsoft.com> wrote in message
news:CB71D7E5-0534-404B-8787-1F2F527F0D0A@.microsoft.com...
> Hello, I woud like to find a resource (book, web site, etc.) that
> demonstrates writing queries related to parent/child relationships. In
> particular I have a table that contains an unknown number of
> parents/children
> (and grand-children, great grand children, etc). I would like to create a
> pivot table so that all the parents become columns and each row represents
> a
> child (grand child, great grand child, etc.) for that parent.
> Thank you,
> Ric|||"Tony Rogerson" <tonyrogerson@.sqlserverfaq.com> wrote in message
news:OEbv0ykIGHA.3896@.TK2MSFTNGP15.phx.gbl...
> Check out the stuff Izik Ben Gan has done on trees and hierarchies.
Yes, but why isn't there dedicated sql for this?
Even if they had to use xml? :)
I know, it's a high priority for a future release......Please:):(

> Don't buy celko's book, its based around standard sql rather than
> Microsoft SQL Server so you'll find it hard to implement, also, a lot of
> his methods are slow, dont scale and out of date.
Yes, but why is it so popular on this ng?
Required reading according to many of the experts!
The twilight is blinding...:)
www.rac4sql.net|||>> Yes, but why isn't there dedicated sql for this? Even if they had to use
xml? :) <<
Recursive CTE expressions are now a part of Standard SQL. I like CTEs
but I do not like the recursirve version -- it seldom used so it
destorts the engine and it is a screaming XXXXX to optimize.
You silly boy! Because this book is the brilliant work of a known SQL
genius, who is kind to animals, God's gift to strippers as well as
undergrad math students, and so much nicer in person than on
Newsgroups!! Soon to be listed on a webite for sainthood ..
Seriously, if you cannot translate Standard SQL into any product
dialect, then you are a truly bad SQL programmer. This is like saying
"I only speak Hillbilly English and cannot leave my ghetto!"
"Caesar: Pardon him, Theodotus. He is a barbarian and thinks the
customs of his tribe and island are the laws of nature." - Caesar and
Cleopatra; George Bernard Shaw 1898|||> ...God's gift to strippers as well as
> undergrad math students...
Geez! LOL :)

> Soon to be listed on a webite for sainthood...
Be sure to post the link. ;)
ML
http://milambda.blogspot.com/|||>> > Soon to be listed on a website for sainthood...Be sure to post the link
. ;) <<
Well, first, I have to get the domain registered ...

Wednesday, March 21, 2012

parse data

I am trying to parse some logs that I have already in a table and display them in another table or even on a web page (asp). The seperator is a & and a letter (ie &U=) that corrisponds to certain parameter. Does anyone have a script or stored procedure th
at will take each paramter and put it in a seperate field?
Go to Start --> Programs --> Microsoft SQL Server --> Server Network Utility. It should list the SQL Instances that you have installed on your computer. Hope this helps.
Tea C.
"sony5689" wrote:

> I am trying to parse some logs that I have already in a table and display them in another table or even on a web page (asp). The seperator is a & and a letter (ie &U=) that corrisponds to certain parameter. Does anyone have a script or stored procedure
that will take each paramter and put it in a seperate field?

Monday, March 12, 2012

Parameters via a web service

Hy,

I have to build a report. this report has to be call by a web service. My method to call this report is :


[WebMethod]

public void Amende()

{

ReportingService rs = new localhost.ReportingService();

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

byte[] ResultStream; // bytearray for result stream

string[] StreamIdentifiers; // string array for stream idenfiers

string OptionalParam = null; // string out param for optional parameters

ParameterValue[] optionalParams = null; // parametervalue array for optional parameters

Warning[] optionalWarnings = null; // warning array for optional warnings

ResultStream = rs.Render("/SwatFillingDocuments/AMAD AYDIN 1198 2005 MD", "PDF", null,

"<DeviceInfo><StreamRoot>/RSWebServiceXS/</StreamRoot></DeviceInfo>", null, null,

null, out OptionalParam, out OptionalParam, out optionalParams,

out optionalWarnings, out StreamIdentifiers);

// Write the report to Response

HttpContext.Current.Response.BinaryWrite(ResultStream);

}


But in my report I have a parameter. And I have to give a value at this parameter via my web service. Is it possible to do that with the method Render?

oki I found how to give a parameter. So my code looks like that now:

[WebMethod]

public void Amende( string dossierId )

{

ReportingService rs = new localhost.ReportingService();

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

byte[] resultStream; // bytearray for result stream

string[] streamIdentifiers; // string array for stream idenfiers

string optionalParam = null; // string out param for optional parameters

ParameterValue[] optionalParams = null; // parametervalue array for optional parameters

// Prparation de la valeur passe en paramètre

ParameterValue[] parameters = new ParameterValue[1];

parameters[0] = new ParameterValue();

parameters[0].Name = "DossiersId";

parameters[0].Value = dossierId;

DataSourceCredentials[] credentials = null;

string showHideToggle = null;

string historyID = null;

Warning[] optionalWarnings = null; // warning array for optional warnings

resultStream = rs.Render("/SwatFillingDocuments/AMAD AYDIN 1198 2005 MD", "PDF",

historyID, @."False", parameters,credentials,showHideToggle,out optionalParam,

out optionalParam,out optionalParams, out optionalWarnings,out streamIdentifiers);

HttpContext.Current.Response.BinaryWrite(resultStream);

}

But when I put a parameter in my web service I have an error :

System.Net.WebException: The request failed with HTTP status 400: Bad Request.

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

at localhost.ReportingService.Render(String Report, String Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters, DataSourceCredentials[] Credentials, String ShowHideToggle, String& Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]& Warnings, String[]& StreamIds) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\listreports\5d760f1a\6c0731c0\App_WebReferences.n1-mytpw.0.cs:line 1706

at Service.Amende(String dossierId) in c:\projects\ListReports\App_Code\Service.cs:line 36

Can you help me please? If I use this mothed without parameter it works but when i try to give a parameter it fails.Thank you|||

I do this in VB. This writes the report out to a disk after you get the byte array. This code is from inside a class that I wrap the process in so I havent't looked at it in awhile but it has been working without errors.

Public Sub RenderWriter()

Dim parameters() As MyReportService.ParameterValue

parameters = GetParameters()

Dim encoding As String

Dim mimeType As String

Dim parametersUsed() As MyReportService.ParameterValue

Dim warnings() As MyReportService.Warning

Dim streamIds() As String

'render the report

Dim data() As Byte

'data = _rs.Render(Me._ReportItem.Path, _Format.Name, Nothing, Nothing, parameters, Nothing, Nothing, encoding, mimeType, parametersUsed, warnings, streamIds)

data = _rs.Render(ReportItem.Path, Format.Name, Nothing, Nothing, parameters, Nothing, Nothing, encoding, mimeType, parametersUsed, warnings, streamIds)

'//create a file stream to write the output

'Dim fileName As String = _OutputPath & "\" & _ReportItem.Name & _Format.Extension

Write(data)

End Sub

Private Sub Write(ByVal data() As Byte)

Dim fs As New System.IO.FileStream(Me.FileName, System.IO.FileMode.OpenOrCreate)

Dim writer As New System.IO.BinaryWriter(fs)

writer.Write(Data, 0, Data.Length)

writer.Close()

fs.Close()

End Sub

Private Function GetParameters() As MyReportService.ParameterValue()

Dim i As Integer

Dim len As Integer = _ParamValues.Count - 1

Dim returnValues(len) As MyReportService.ParameterValue

For i = 0 To len

returnValues(i) = New MyReportService.ParameterValue

returnValues(i).Name = _ParamValues.Item(i).Name

returnValues(i).Value = _ParamValues.Item(i).Value

Next i

Return returnValues

End Function

Parameters to insert data from form into SQL database

Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0
That's what you inserted. :-)
Try:
cmdTest.Parameters("@.FirstN").Value = "John"
cmdTest.Parameters("@.LastN").Value = "Doe"
cmdTest.Parameters("@.Org").Value = "FLy by Night Airlines"
cmdTest.Parameters("@.Addr1").Value = "123 Main St"
cmdTest.Parameters("@.City").Value = "Anytown"
cmdTest.Parameters("@.Email").Value = nospam@.nospam.com
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
<hery@.infoventures.com> wrote in message
news:1141152263.896973.136620@.p10g2000cwp.googlegr oups.com...
Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0
|||Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0
|||I'd check the database directly with Query Analyzer (QA) if you're using SQL
2000 or SQL Server Management Studio (SSMS) if you're using SQL 2005. Also,
consider using SQL Profiler to see what is being sent to SQL Server. There
could be a problem in your VB .NET code somewhere.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
<hery@.infoventures.com> wrote in message
news:1141156805.957210.276400@.j33g2000cwa.googlegr oups.com...
Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0

Parameters to insert data from form into SQL database

Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0That's what you inserted. :-)
Try:
cmdTest.Parameters("@.FirstN").Value = "John"
cmdTest.Parameters("@.LastN").Value = "Doe"
cmdTest.Parameters("@.Org").Value = "FLy by Night Airlines"
cmdTest.Parameters("@.Addr1").Value = "123 Main St"
cmdTest.Parameters("@.City").Value = "Anytown"
cmdTest.Parameters("@.Email").Value = nospam@.nospam.com
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<hery@.infoventures.com> wrote in message
news:1141152263.896973.136620@.p10g2000cwp.googlegroups.com...
Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0|||Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0|||I'd check the database directly with Query Analyzer (QA) if you're using SQL
2000 or SQL Server Management Studio (SSMS) if you're using SQL 2005. Also,
consider using SQL Profiler to see what is being sent to SQL Server. There
could be a problem in your VB .NET code somewhere.
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<hery@.infoventures.com> wrote in message
news:1141156805.957210.276400@.j33g2000cwa.googlegroups.com...
Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0

Parameters to insert data from form into SQL database

Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0That's what you inserted. :-)
Try:
cmdTest.Parameters("@.FirstN").Value = "John"
cmdTest.Parameters("@.LastN").Value = "Doe"
cmdTest.Parameters("@.Org").Value = "FLy by Night Airlines"
cmdTest.Parameters("@.Addr1").Value = "123 Main St"
cmdTest.Parameters("@.City").Value = "Anytown"
cmdTest.Parameters("@.Email").Value = nospam@.nospam.com
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<hery@.infoventures.com> wrote in message
news:1141152263.896973.136620@.p10g2000cwp.googlegroups.com...
Hi,
I'm having problem inserting and storing data from asp.net web form to
SQL database. I use the following parameters for the SqlCommand object
to do the insert:
cmdTest.Parameters.Add(New SqlParameter("@.FirstN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.LastN",
SqlDbType.NVarChar, 25))
cmdTest.Parameters.Add(New SqlParameter("@.Org",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Addr1",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.City",
SqlDbType.NVarChar, 50))
cmdTest.Parameters.Add(New SqlParameter("@.Email",
SqlDbType.NVarChar, 50))
cmdTest.Parameters("@.FirstN").Value = "FirstN"
cmdTest.Parameters("@.LastN").Value = "LastN"
cmdTest.Parameters("@.Org").Value = "Org"
cmdTest.Parameters("@.Addr1").Value = "Addr1"
cmdTest.Parameters("@.City").Value = "City"
cmdTest.Parameters("@.Email").Value = "Email"
It seems like the value of the fields didn't get inserted when I submit
the page. All I'm getting is just the names of the fields (e.g. FirstN,
LastN), not the values themselves (e.g. John, Doe).
Can anyone help me?
Thanks,
hfk0|||Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0|||I'd check the database directly with Query Analyzer (QA) if you're using SQL
2000 or SQL Server Management Studio (SSMS) if you're using SQL 2005. Also,
consider using SQL Profiler to see what is being sent to SQL Server. There
could be a problem in your VB .NET code somewhere.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
<hery@.infoventures.com> wrote in message
news:1141156805.957210.276400@.j33g2000cwa.googlegroups.com...
Hi Tom,
Oh ok I get it now...I guess whatever I put within the "" is what is
inserted.
I'm also adding the following parameters:
cmdTest.Parameters.Add(New SqlParameter("@.State", SqlDbType.NChar, 2))
cmdTest.Parameters.Add(New SqlParameter("@.Phone", SqlDbType.NChar, 10))
cmdTest.Parameters("@.State").Value = State.SelectedItem.Value
cmdTest.Parameters("@.Phone").Value = Phone.Text
When viewing the page, somehow these two values didn't get inserted to
the database.
Did I use the wrong data type?
Thanks again,
hfk0

Parameters Passing

Hi,
In MSRS 2000 I use pass the parameters from a web page like this
ReportViewer1.ReportPath = "/RptProj/EMPINFO&EMPNO=00004";
ReportViewer1.ServerUrl = "http://<ServerName>/ReportServer";
In MSRS 2005 Iam trying this but it is not working (Even with "&" insted of the "?")
ReportViewer1.ServerReport.ReportPath = "/ReportingProject/EmpReport?ManagerID=3";
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://<ServerName>/ReportServer");
can any body tell me what what wrong in this & how do I fix it??

which mode you use? Local mode or Remote mode?

|||Remote mode

Friday, March 9, 2012

parameters layout on the web page.... why?

hello,
this has been buggin me for a while, and i've found no answer. why do
parameters get randomly stacked instead of filling out an entire width of
the page?
for example, i have 6 parameters on one report, and they're all combo
boxes... relatively short ones. they're stacked in 2 columns of 3. and they
barely strech to 1/4 of the page width... this looks VERY ugly.
why does it do this? any way to change this?
any help would be GREATLY appreciated
dushan bilbijaThe best way is to build your own COntrol for that which redirects to the
original Report passing the parameters.
With this you are very "designfree" :-)
HTH, Jens Süßmeyer.
--
http://www.sqlserver2005.de
--
"Dushan Bilbija" <dbilbija@.msn.com> schrieb im Newsbeitrag
news:usE3OYGQFHA.2384@.tk2msftngp13.phx.gbl...
> hello,
> this has been buggin me for a while, and i've found no answer. why do
> parameters get randomly stacked instead of filling out an entire width of
> the page?
> for example, i have 6 parameters on one report, and they're all combo
> boxes... relatively short ones. they're stacked in 2 columns of 3. and
> they barely strech to 1/4 of the page width... this looks VERY ugly.
> why does it do this? any way to change this?
> any help would be GREATLY appreciated
> dushan bilbija
>

parameters in a webapplication with a webservice

Hi,
I used a webservice (a reference web) in my webapplication in order to view
my report. However, my report has a parameter.
I don't know what to do. Are they any function with the ReportingService to
do this?
What are the steps to give a parameter to my report?Hi,
Take a look at the Render method. It is used to call the ReportService to
render a given report. You can provide parameters, output format, device
information and some other information. It returns a byte().
Hope this would help you further.
Jan Pieter Posthuma
"r388042" wrote:
> Hi,
> I used a webservice (a reference web) in my webapplication in order to view
> my report. However, my report has a parameter.
> I don't know what to do. Are they any function with the ReportingService to
> do this?
> What are the steps to give a parameter to my report?