Stored Procedure

  • Thread starter Thread starter Sandie
  • Start date Start date
S

Sandie

I'm using a web service for a windows application and and
in my webmethod I use a stored procedure to do the insert
to a certain table. The field was set at char(10) which
was to small for all the data I am collecting in the
windows application the field collects the OS system from
the clients computer so it reads in the application
as "Microsoft Windows XP Professional 5.1.2600" but
inserts as "Microsoft" I changed the field size both in
the db and in the stored procedure and it doesnt matter it
still doesnt work, if I do it from the web service page
and invoke it from there it works just fine. It also
works from a free standing web page, and I can run it from
the query analyzer and it works there to, but when I run
the profiler on it it only takes the first 10 characters
which would be the word Microsoft and a spave. I have
recompiled the code lots of times and it doesnt seem to
make a difference, if I run it will I run ethereal on the
server it appears all the correct data is passing. So I
am not really sure where it is losing it.

Any ideas would be great because we are stumped!.

Thanks in advance for your help!
 
Im not sure where I would of done that at. If you talking
about the wsdl no it isnt there either it has no max
limit, the reference.cs we checked as well and its not
there either.

Can you tell me where I should look?
 
1. Restart Web server after making modifications

2. Create a new store procedure to test this problem.

3. Add trace information in the .aspx file.

4. How did you insert the data from the client side?


Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| Content-Class: urn:content-classes:message
| From: "Sandie" <[email protected]>
| Sender: "Sandie" <[email protected]>
| References: <[email protected]>
<#[email protected]>
| Subject: Re: Stored Procedure
| Date: Thu, 7 Aug 2003 03:45:25 -0700
| Lines: 48
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNc0QKXRvT7oG6sRAmzKTL6zWVq/w==
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57649
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Im not sure where I would of done that at. If you talking
| about the wsdl no it isnt there either it has no max
| limit, the reference.cs we checked as well and its not
| there either.
|
| Can you tell me where I should look?
|
| >-----Original Message-----
| >How is your windows application declaring the parameter
| to the stored
| >procedure? Are you explicitly setting the size to 10?
| >
| >| >> I'm using a web service for a windows application and
| and
| >> in my webmethod I use a stored procedure to do the
| insert
| >> to a certain table. The field was set at char(10) which
| >> was to small for all the data I am collecting in the
| >> windows application the field collects the OS system
| from
| >> the clients computer so it reads in the application
| >> as "Microsoft Windows XP Professional 5.1.2600" but
| >> inserts as "Microsoft" I changed the field size both in
| >> the db and in the stored procedure and it doesnt matter
| it
| >> still doesnt work, if I do it from the web service page
| >> and invoke it from there it works just fine. It also
| >> works from a free standing web page, and I can run it
| from
| >> the query analyzer and it works there to, but when I run
| >> the profiler on it it only takes the first 10 characters
| >> which would be the word Microsoft and a spave. I have
| >> recompiled the code lots of times and it doesnt seem to
| >> make a difference, if I run it will I run ethereal on
| the
| >> server it appears all the correct data is passing. So I
| >> am not really sure where it is losing it.
| >>
| >> Any ideas would be great because we are stumped!.
| >>
| >> Thanks in advance for your help!
| >>
| >
| >
| >.
| >
|
 
The web server is in production and I cant take it down in
less its a last resort.

I did create a new stored procedure and the same thing
happens.

This isnt an asp.net application its a windows application
that uses a web service.

From the windows application the data is inserted through
the web service with this code:

[WebMethod]
public string SaveDevice(string Ori,string Device, string
os, string osVrs, string diskSpace,
string cpu, string memory, string resolution, string ip,
string ieVrs, string ieServicePck)
{
string theDeviceReturnValue = "";
try
{
SqlConnection conn = new SqlConnection
(System.Configuration.ConfigurationSettings.AppSettings
["connectionString"]);

conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "st_SaveDevice";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add
("@Agency_Ori",SqlDbType.Char,10,"Agency_Ori");
cmd.Parameters.Add
("@Device_ID",SqlDbType.Char,5,"Device_ID");
cmd.Parameters.Add
("@OS_System",SqlDbType.Char,250,"OS_System");
cmd.Parameters.Add
("@OS_ServicePack",SqlDbType.Char,75,"OS_ServicePack");
cmd.Parameters.Add
("@FreeDiskSpace",SqlDbType.Char,5,"FreeDiskSpace");
cmd.Parameters.Add("@Cpu_MHZ",SqlDbType.Char,10,"Cpu_MHZ");
cmd.Parameters.Add
("@Main_Memory",SqlDbType.Char,10,"Main_Memory");
cmd.Parameters.Add
("@ScreenResolution",SqlDbType.Char,10,"ScreenResolution");
cmd.Parameters.Add
("@IPAddress",SqlDbType.Char,15,"IPAddress");
cmd.Parameters.Add("@IE_Vrs",SqlDbType.Char,10,"IE_Vrs");
cmd.Parameters.Add
("@IE_ServicePackVrs",SqlDbType.Char,10,"IE_ServicePackVrs"
);
cmd.Parameters["@Agency_Ori"].Value = Ori;
cmd.Parameters["@Device_ID"].Value = Device;
cmd.Parameters["@OS_System"].Value = os;
cmd.Parameters["@OS_ServicePack"].Value = osVrs;
cmd.Parameters["@FreeDiskSpace"].Value = diskSpace;
cmd.Parameters["@Cpu_MHZ"].Value = cpu;
cmd.Parameters["@Main_Memory"].Value = memory;
cmd.Parameters["@ScreenResolution"].Value = resolution;
cmd.Parameters["@IPAddress"].Value = ip;
cmd.Parameters["@IE_Vrs"].Value = ieVrs;
cmd.Parameters["@IE_ServicePackVrs"].Value = ieServicePck;
cmd.Connection = conn;
int num = cmd.ExecuteNonQuery();
if(num != 0)
theDeviceReturnValue = "Device Data Save Successful, Exit
the Application" ;
}
catch(Exception e)
{
theDeviceReturnValue = e.Message;
}
return theDeviceReturnValue;
}


I'm posting here because I had a post in the sql group and
we went through everything there and still no luck. Thanks
 
Do you mean the parameter:

"@OS_System",SqlDbType.Char,250,"OS_System");

Does the same problem occur if changing the size from 250 to 200?

Also, does the same problem occur in other fields such as OS_ServicePack
parameter?

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| Content-Class: urn:content-classes:message
| From: "Sandie" <[email protected]>
| Sender: "Sandie" <[email protected]>
| References: <[email protected]>
<#[email protected]>
<[email protected]>
<uc67yY#[email protected]>
| Subject: Re: Stored Procedure
| Date: Mon, 11 Aug 2003 04:55:23 -0700
| Lines: 186
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNf/3IiCjDjcwrsQ6aziARL8CBetA==
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57984
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| The web server is in production and I cant take it down in
| less its a last resort.
|
| I did create a new stored procedure and the same thing
| happens.
|
| This isnt an asp.net application its a windows application
| that uses a web service.
|
| From the windows application the data is inserted through
| the web service with this code:
|
| [WebMethod]
| public string SaveDevice(string Ori,string Device, string
| os, string osVrs, string diskSpace,
| string cpu, string memory, string resolution, string ip,
| string ieVrs, string ieServicePck)
| {
| string theDeviceReturnValue = "";
| try
| {
| SqlConnection conn = new SqlConnection
| (System.Configuration.ConfigurationSettings.AppSettings
| ["connectionString"]);
|
| conn.Open();
| SqlCommand cmd = new SqlCommand();
| cmd.CommandText = "st_SaveDevice";
| cmd.CommandType = CommandType.StoredProcedure;
| cmd.Parameters.Add
| ("@Agency_Ori",SqlDbType.Char,10,"Agency_Ori");
| cmd.Parameters.Add
| ("@Device_ID",SqlDbType.Char,5,"Device_ID");
| cmd.Parameters.Add
| ("@OS_System",SqlDbType.Char,250,"OS_System");
| cmd.Parameters.Add
| ("@OS_ServicePack",SqlDbType.Char,75,"OS_ServicePack");
| cmd.Parameters.Add
| ("@FreeDiskSpace",SqlDbType.Char,5,"FreeDiskSpace");
| cmd.Parameters.Add("@Cpu_MHZ",SqlDbType.Char,10,"Cpu_MHZ");
| cmd.Parameters.Add
| ("@Main_Memory",SqlDbType.Char,10,"Main_Memory");
| cmd.Parameters.Add
| ("@ScreenResolution",SqlDbType.Char,10,"ScreenResolution");
| cmd.Parameters.Add
| ("@IPAddress",SqlDbType.Char,15,"IPAddress");
| cmd.Parameters.Add("@IE_Vrs",SqlDbType.Char,10,"IE_Vrs");
| cmd.Parameters.Add
| ("@IE_ServicePackVrs",SqlDbType.Char,10,"IE_ServicePackVrs"
| );
| cmd.Parameters["@Agency_Ori"].Value = Ori;
| cmd.Parameters["@Device_ID"].Value = Device;
| cmd.Parameters["@OS_System"].Value = os;
| cmd.Parameters["@OS_ServicePack"].Value = osVrs;
| cmd.Parameters["@FreeDiskSpace"].Value = diskSpace;
| cmd.Parameters["@Cpu_MHZ"].Value = cpu;
| cmd.Parameters["@Main_Memory"].Value = memory;
| cmd.Parameters["@ScreenResolution"].Value = resolution;
| cmd.Parameters["@IPAddress"].Value = ip;
| cmd.Parameters["@IE_Vrs"].Value = ieVrs;
| cmd.Parameters["@IE_ServicePackVrs"].Value = ieServicePck;
| cmd.Connection = conn;
| int num = cmd.ExecuteNonQuery();
| if(num != 0)
| theDeviceReturnValue = "Device Data Save Successful, Exit
| the Application" ;
| }
| catch(Exception e)
| {
| theDeviceReturnValue = e.Message;
| }
| return theDeviceReturnValue;
| }
|
|
| I'm posting here because I had a post in the sql group and
| we went through everything there and still no luck. Thanks
| >-----Original Message-----
| >1. Restart Web server after making modifications
| >
| >2. Create a new store procedure to test this problem.
| >
| >3. Add trace information in the .aspx file.
| >
| >4. How did you insert the data from the client side?
| >
| >
| >Sincerely,
| >
| >Kevin
| >Microsoft Support
| >
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
| >Get Secure! - www.microsoft.com/security
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Sandie" <[email protected]>
| >| Sender: "Sandie" <[email protected]>
| >| References: <[email protected]>
| ><#[email protected]>
| >| Subject: Re: Stored Procedure
| >| Date: Thu, 7 Aug 2003 03:45:25 -0700
| >| Lines: 48
| >| Message-ID: <[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Thread-Index: AcNc0QKXRvT7oG6sRAmzKTL6zWVq/w==
| >| Newsgroups: microsoft.public.dotnet.framework.adonet
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:57649
| >| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| >| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| >|
| >| Im not sure where I would of done that at. If you
| talking
| >| about the wsdl no it isnt there either it has no max
| >| limit, the reference.cs we checked as well and its not
| >| there either.
| >|
| >| Can you tell me where I should look?
| >|
| >| >-----Original Message-----
| >| >How is your windows application declaring the
| parameter
| >| to the stored
| >| >procedure? Are you explicitly setting the size to 10?
| >| >
| >| >| >| >> I'm using a web service for a windows application
| and
| >| and
| >| >> in my webmethod I use a stored procedure to do the
| >| insert
| >| >> to a certain table. The field was set at char(10)
| which
| >| >> was to small for all the data I am collecting in the
| >| >> windows application the field collects the OS system
| >| from
| >| >> the clients computer so it reads in the application
| >| >> as "Microsoft Windows XP Professional 5.1.2600" but
| >| >> inserts as "Microsoft" I changed the field size both
| in
| >| >> the db and in the stored procedure and it doesnt
| matter
| >| it
| >| >> still doesnt work, if I do it from the web service
| page
| >| >> and invoke it from there it works just fine. It also
| >| >> works from a free standing web page, and I can run
| it
| >| from
| >| >> the query analyzer and it works there to, but when I
| run
| >| >> the profiler on it it only takes the first 10
| characters
| >| >> which would be the word Microsoft and a spave. I
| have
| >| >> recompiled the code lots of times and it doesnt seem
| to
| >| >> make a difference, if I run it will I run ethereal
| on
| >| the
| >| >> server it appears all the correct data is passing.
| So I
| >| >> am not really sure where it is losing it.
| >| >>
| >| >> Any ideas would be great because we are stumped!.
| >| >>
| >| >> Thanks in advance for your help!
| >| >>
| >| >
| >| >
| >| >.
| >| >
| >|
| >
| >.
| >
|
 
"@OS_System",SqlDbType.Char,250,"OS_System"); is the field that was
changed from 10 to 250 and is the field that seems to limit the
characters coming in. Both the SP and the code and the table allow Char
250.

Nope the other fields are fine and I had to change them too. The weird
thing is if I try to invoke it from the asmx page it goes in just fine
so it has to be something in the code that sticks or something because
it doesnt seem to get it all the way through. I ran the profiler as I
ran through the application as well. It only shows 'Microsoft ', like
that going in. it cuts the rest off.

Stokh
 
I am performing further research on my side and will get back to you ASAP.

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: Stokh <[email protected]>
| References: <[email protected]>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: Re: Stored Procedure
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Date: Thu, 14 Aug 2003 05:34:16 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:58375
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| "@OS_System",SqlDbType.Char,250,"OS_System"); is the field that was
| changed from 10 to 250 and is the field that seems to limit the
| characters coming in. Both the SP and the code and the table allow Char
| 250.
|
| Nope the other fields are fine and I had to change them too. The weird
| thing is if I try to invoke it from the asmx page it goes in just fine
| so it has to be something in the code that sticks or something because
| it doesnt seem to get it all the way through. I ran the profiler as I
| ran through the application as well. It only shows 'Microsoft ', like
| that going in. it cuts the rest off.
|
| Stokh
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
Some suggestions:

Create a new simple web server from the scratch by using wizard in VS.NET.
Then add the ADO.NET related code to call the store procedure. Does the
same problem occur?

Based on your test results, the asmx file should run the ADO.NET code to
call the store procedure. however, you stated that the profiler that
mornitor the store procedure shows that the parameter is not returned
correctly. It seems that the store procedure called by the asmx and the
profiler is not same.

By implementing a new web server, we can double-check this strange issue.


Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| X-Tomcat-ID: 124687217
| References: <[email protected]>
<#[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Kevin Sun [MS])
| Organization: Microsoft
| Date: Mon, 18 Aug 2003 06:58:46 GMT
| Subject: Re: Stored Procedure
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| Lines: 45
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:58532
| NNTP-Posting-Host: TOMCATIMPORT2 10.201.218.182
|
| I am performing further research on my side and will get back to you ASAP.
|
| Sincerely,
|
| Kevin
| Microsoft Support
|
| This posting is provided "AS IS" with no warranties, and confers no
rights.
| Get Secure! - www.microsoft.com/security
|
| --------------------
| | From: Stokh <[email protected]>
| | References: <[email protected]>
| | X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| | Subject: Re: Stored Procedure
| | Mime-Version: 1.0
| | Content-Type: text/plain; charset="us-ascii"
| | Content-Transfer-Encoding: 7bit
| | Message-ID: <#[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.adonet
| | Date: Thu, 14 Aug 2003 05:34:16 -0700
| | NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| | Lines: 1
| | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.adonet:58375
| | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| |
| | "@OS_System",SqlDbType.Char,250,"OS_System"); is the field that was
| | changed from 10 to 250 and is the field that seems to limit the
| | characters coming in. Both the SP and the code and the table allow Char
| | 250.
| |
| | Nope the other fields are fine and I had to change them too. The weird
| | thing is if I try to invoke it from the asmx page it goes in just fine
| | so it has to be something in the code that sticks or something because
| | it doesnt seem to get it all the way through. I ran the profiler as I
| | ran through the application as well. It only shows 'Microsoft ', like
| | that going in. it cuts the rest off.
| |
| | Stokh
| |
| |
| | Don't just participate in USENET...get rewarded for it!
| |
|
|
 
Back
Top