Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Friday, March 30, 2012

having trouble connecting to database

Hi I am new at this.

I have a little program written in C# in asp.net. The program basically accesses a database and stores new records. The database is supposedly already attached to MSDE so I am able to see the tables of the database inside asp.net. I can click on the individual slots of the table and modify the datas manually. However, I want to connect to the database from my C# program and be able to input data into the database via the website that the C# program produces. After I type in the data into the website and click the submit button on the website, I get an error page that says this:

Login failed for user 'sa'

the line of code thats causing this error is:

con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");

Why is it not able to connect to the database?

YourChild:


con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");



I am taking the liberty to presume that your database name is Friends.I just couldn't figure what the "\\NetSdk" means. Perhaps you can addsomething to my knowledge.

Most probably if you aren't using Integrated Security for accessing thedatabase, you'd need to specify the password in the connection stringas well. You can make it something like this:

con =new SqlConnection("data source=(local);initial catalog=Friends;user id=sa;pwd="yourpassword")
Remember,it is a bad habit to store your connection string in the code. Tryputting it in the web.config, but you might want to do this later, whenyou get the hang of things.

Smiles.|||

uXuf:

YourChild:


con =

new SqlConnection("data source=(local)\\NetSdk; initial catalog=Friends; user id=sa");



I am taking the liberty to presume that your database name is Friends. I just couldn't figure what the "\\NetSdk" means. Perhaps you can add something to my knowledge.

Most probably if you aren't using Integrated Security for accessing the database, you'd need to specify the password in the connection string as well. You can make it something like this:

con =new SqlConnection("data source=(local);initial catalog=Friends;user id=sa;pwd="yourpassword")

Remember, it is a bad habit to store your connection string in the code. Try putting it in the web.config, but you might want to do this later, when you get the hang of things.

Smiles.

Thank you it works! I'm so glad you came by! now I am in the process of trying to stick the 'userName' and 'password' into the web.config file by using:

<

identityimpersonate="true"userName="sa"password="mypassword"/>

only now when I hit compile, Windows is giving me an error that says:

"Unable to start debugging on the web server. Server side-error occurred on sending debug HTTP request." Do I need to change something else to make this work?

There is another piece of code at the top of the web.config file that looks like this:

<authenticationmode="None"/>

Should "None" be set to "Windows"?

Then there is another username and password inside the "Directory Security" in IIS via 'property' for the virtual directory corresponding to the directory of the project. Is this username and password associated with the userName and password used to access the database?

Having some trouble connecting to a database....

I am doing one of the Microsoft virtual labs "Creating ASP.NET Web Applications with C# - Part 2" using Visual Web Developer Express. I am trying to fill a gridview with database information, but it gives me the error

"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)".

This is on the local machine that I am executing the code.

public void BindGrid(string sortfield) {//Create DataAdapter to fetch data from Prodcuts table SqlDataAdapter myCommand =new SqlDataAdapter("select * from Products", myConnection);//Create dataset and fill it with Product data DataSet ds =new DataSet(); myCommand.Fill(ds,"Products");//Bind Product data to Datagrid DataView Source = ds.Tables["Products"].DefaultView; Source.Sort = sortfield; dgProducts.DataSource = Source; dgProducts.DataBind(); }

It stops on the line "myCommand.Fill(ds, "Products"); and points out the error mentioned earlier. I am not sure what to do...any help would be greatly appreciated, thanks in advance, and I apologize as well if I have not pointed out enough information.

What does your connection string look like?|||

check this link for help:

http://support.microsoft.com/kb/914277/en-us

Thanks

|||

First of all, thank you both greatly for responding.

Smalltalk, here is the connection string:

myConnection = new SqlConnection("server=localhost;database=northwind;Trusted_Connection=yes");

Jpazgier, my connections are set at local and remote connections, plus the server is on the same machine, I have no idea why it mentions that error for me.

Thanks again, guys.

|||

Hi GWShane,

Please make sure that the server is the default instance on your machine. If you're using SQL Express, the default name for this instance might be SQLExpress. In this case, you might need to add the instance name to the DataSource like:

myConnection = new SqlConnection("server=localhost\\SQLExpress;database=northwind;Trusted_Connection=yes");

Wednesday, March 28, 2012

HAVING PROBLEMS INSTALLING THE SQL 2005 EXPRESS

hello, I am having some problems installing the sql 2005 express that comes with the asp.net 2.0

It says that the installation failed thats all. Anyone with that kind of problem?

Installation failure is not so easy to troubleshoot... If you had installed beta version of VS2005, you'd better uninstall the existing components completely. Here is a uninstall tool for VS2005:

http://msdn.microsoft.com/vstudio/support/uninstall/default.aspx

If you want to troubleshoot the installation, you can take a look at these posts:

http://forums.asp.net/thread/1290342.aspx

http://forums.asp.net/thread/1306350.aspx

Monday, March 26, 2012

Having a problem with ReportViewer Drill-Throughs

I'm having a problem with the Report Viewer in ASP.NET. I have a report that drills-through to other reports using the Action->Jump to report setting. This works perfectly in the VS Report Builder Preview screen, as well as in the Report Manager when I upload it. However, on my aspx page, clicking any item in the viewer makes the page just refresh. I can't find any articles on this anywhere. Any Ideas?You guys are ridiculously helpful, by the way.Anything on this? I really don't understand what's going on.|||Finally figured this out.You need to add a handler for the Drillthrough event, and make sure you're not reloading your main report on Postback.sql

Having a hard time connecting to sample SQL database from ASP.Net Page

I am working through the book ASP.Net Unleashed Second Addition. I am trying to open a simple database connection. (using the sample "pubs" db from SQL Server)
I have copied the author's code exactly, but it just won't work. I keep getting this error:
What am I doing wrong???Confused [*-)]

Description:An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message:BC30182: Type expected.
Source Error:
Line 5: Line 6: Sub Page_LoadLine 7: Dim conPubs As SqlConnectionLine 8: conPubs = New SqlConnection( "server=localhost;uid=webuser;pwd=secret;database=pubs" )Line 9: conPubs.Open()
What namespaces have you imported?|||Coding for my namespace is
<%@. Import Namespace="System.Data.SqlClient" %>
This is copied directly from the authors example.... so I don't know if it is right lolWink [;)]
Then under the page_load event
I typed:
<script Runat="server">
Sub Page_Load
Dim conPubs as SqlConnection
conPubs = New SqlConnection( "Server=localhost;uid=sa;pwd=secret;database=pubs" )
conPubs. Open()
End Sub
</script>
The text "Connection Opened!" Is supposed to show up if the coding is correct...
Help hehe just a beginner :)|||Does anyone know some awesome websites that teach you Visual Studio.Net 2003 and database stuff? I have the hardest time finding things in the MSDN library....|||Try:
http://learnvisualstudio.net/|||

I don't know if VB.NEt support the continuation stuff.
If it does, may be u have to put a continuation sign at the end of line 7.
Cheers.

sql

Friday, March 23, 2012

Have a problem with UpdateCommand

Hello everyone,

I am a bit new to ASP .Net so forgive me, if I dont understand something right off.

I am writing a page that gets code from the SQL database and puts it into a GridView. To get the information I am using SqlDataSource. I cant post an error message because I am running this off remote server but though testing I figure that it crashes when I add

Analysis = @.Analysis

line into the UpdateCommand. First I thought that maybe my parameters were not read correcty but when I tried something like

Analysis = 6

it worked. Then I tried to replace CQNo=@.CQNo with

CQNo = @.Analysis

and it also worked.

I am very much puzzed at this. In SQL database CQNo is varchar, WorkDate is DateTime and Analysis is Money type.

Can someone please help, I am out of ideas. Thanks!

<asp:SqlDataSourceID="myEfforts"runat="server"SelectCommand="SELECT SNo, CQNo, WorkDate, Analysis, Design, Coding, Testing, DesRev, CodeRev, PeerRev, SysTest, PostInstall, Others, TotEff FROM Effort WHERE EmpId = @.EmpId ORDER BY WorkDate DESC"DeleteCommand="DELETE FROM Effort WHERE SNo=@.SNo"UpdateCommand="UPDATE Effort SET CQNo = @.CQNo, WorkDate=@.WorkDate Analysis=@.Analysis WHERE SNo=@.SNo"><SelectParameters><asp:SessionParameterDefaultValue=""Name="EmpId"SessionField="PR_EmpIDVal"Type="String"/></SelectParameters>Looks like you are missing a comma after @.workdate and before Analysis? Or was that a type during pasting the code here?|||That was a typo when I was pasting the code in here. Sorry|||

I tried this and it works.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SNo" DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="SNo" HeaderText="SNo" ReadOnly="True" SortExpression="SNo" />
<asp:BoundField DataField="CQNo" HeaderText="CQNo" SortExpression="CQNo" />
<asp:BoundField DataField="WorkDate" HeaderText="WorkDate" SortExpression="WorkDate" />
<asp:BoundField DataField="Analysis" HeaderText="Analysis" SortExpression="Analysis" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MSDN_forumConnectionString %>"
DeleteCommand="DELETE FROM [effort] WHERE [SNo] = @.SNo"
SelectCommand="SELECT [SNo], [CQNo], [WorkDate], [Analysis] FROM [effort]"
UpdateCommand="UPDATE [effort] SET [CQNo] = @.CQNo, [WorkDate] = @.WorkDate, [Analysis] = @.Analysis WHERE [SNo] = @.SNo">
<DeleteParameters>
<asp:Parameter Name="SNo" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="CQNo" Type="String" />
<asp:Parameter Name="WorkDate" Type="DateTime" />
<asp:Parameter Name="Analysis" Type="Decimal" />
<asp:Parameter Name="SNo" Type="Int32" />
</UpdateParameters>

</asp:SqlDataSource>

|||Thanks a lot of taking the time, let me try this.|||

It worked! Thanks a lot!!!! Can you please explain what was causing the error (what I was doing wrong)?

Thanks a lot!

|||

I didn't see your whole page so my guess is the problem lies in the updateparameter part. A quick trick for this, you can always drag and drop a gridview to hook up with your table of interest in your database and ask for generating all commands (insert, update, delete). You will get a working copy to modify. Remeber assign a primary key for the table.

Glad you got it to work now.

Friday, March 9, 2012

HardDisk very busy while access SQL db

Dear all:
I'm using IIS6 + ASP + SQL2000sp3a. And between these month, when I connect
to my website, the harddisk will very busy, so my website become very slow.
But after HD read finished, the website will work fine.
I'm using virutal server, and another website work fine because it not
access sql server. I think its DB's problem.
Is there any method to check my db? Should I defrag my db or fix it'
Thank you very much for your read and reply!Fragmentation might be contributing to the performance problem, but there
are also many other problems as well. Performance tuning is a big topic & it
would be hard to suggest any one thing as being the most likely fix for your
problem given the limited info you've given here.
You need to follow a basic performance tuning approach - check high level
system metrics such as cpu, memory, disk queues etc. Then you make further
assumptions based on your observations & perhaps perform deeper system
analysis or go to the sql server performance tuning tools - such as SQL
Profiler. You might determine that large tables are being scanned or there
are concurrency / blocking issues.
The SQL Profiler also provides an out of the box performance tuning template
which is worth looking at. Long running query filtering from Profiler can
often reveal as single or small group of problem queries.
Ultimately, you may even have a hardware resource issue.
You might find some interesting material on
http://www.sql-server-performance.com
HTH
Regards,
Greg Linwood
SQL Server MVP
"Come2" <come2@.ms76.url.com.tw> wrote in message
news:#NWpd4ExDHA.2308@.TK2MSFTNGP11.phx.gbl...
> Dear all:
> I'm using IIS6 + ASP + SQL2000sp3a. And between these month, when I
connect
> to my website, the harddisk will very busy, so my website become very
slow.
> But after HD read finished, the website will work fine.
> I'm using virutal server, and another website work fine because it not
> access sql server. I think its DB's problem.
> Is there any method to check my db? Should I defrag my db or fix it'
> Thank you very much for your read and reply!
>

Monday, February 27, 2012

Handling world time with SQL and ASP.NET

Hi,

I would like to capture date time in my SQL during a certain operation. This piece of data will be displayed to an ASP.NET page.

When displaying the date time, I want it converted to the local time zone equivalent as set in the user's operating system.

What setup do I need on the SQL and the coding in the ASP.NET page?

Thanks.The following MSDN article may help you to understand date & time and also avoid inherant problems when dealing with different time zones.

Best Practices Using DateTime in the .NET

Hope this helps

Regards

Wayne Phipps|||Hi Wayne,

Thanks. That's a great article on issues related to saving and computing date time when daylight saving is relevant.

I'm also looking for saving date time in one time zone, and then display the date time relevant to the target user's system. I managed to find a web site that's dedicated to addressing this issue, SimpleTimeZone .NET Framework Class (http://www.michaelbrumm.com/simpletimezone.html). However I have not evaluated the .NET class concerned.

Thanks again for your reply.

handling parameters that could be missing

I have a search app that I'm developing in ASP.NET
It has 5 parameters
MRN, Name, Sex, DOB, SSN
All or any combination can be used.
what is the best way to handle the non-supplied parameters?
i.e. if the user selects only supplies 'Name' and 'MRN'
I want the SQL for the stored procedure to read as if it were just 2
parameters:
(but have one stored procedure that has parameter holders for all 5)
Select MRN, Name, Sex, DOB, SSN
From Membership
WHERE MRN = 123456 AND Name like 'Johns%'
The way I have been handling this is to rewrite a different SQL statement
for every possible situation, and pass that string to the adapter. But I ca
n
see that I'm not taking advantage of the processing that SQL server could do
in a stored procedure, and for 1.4 Million records, my app is just timing ou
t
all the time.
This must be a common issue. Could someone show me the ideal way to handle
this?Have a look at
http://www.sommarskog.se/dyn-search.html
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"jonefer" <jonefer@.discussions.microsoft.com> wrote in message
news:0FFF3A3A-AB66-4A96-B63E-73E937F7A164@.microsoft.com...
>I have a search app that I'm developing in ASP.NET
> It has 5 parameters
> MRN, Name, Sex, DOB, SSN
> All or any combination can be used.
> what is the best way to handle the non-supplied parameters?
> i.e. if the user selects only supplies 'Name' and 'MRN'
> I want the SQL for the stored procedure to read as if it were just 2
> parameters:
> (but have one stored procedure that has parameter holders for all 5)
> Select MRN, Name, Sex, DOB, SSN
> From Membership
> WHERE MRN = 123456 AND Name like 'Johns%'
> The way I have been handling this is to rewrite a different SQL statement
> for every possible situation, and pass that string to the adapter. But I
> can
> see that I'm not taking advantage of the processing that SQL server could
> do
> in a stored procedure, and for 1.4 Million records, my app is just timing
> out
> all the time.
> This must be a common issue. Could someone show me the ideal way to
> handle
> this?
>|||"jonefer" wrote:
> I have a search app that I'm developing in ASP.NET
> It has 5 parameters
> MRN, Name, Sex, DOB, SSN
> All or any combination can be used.
> what is the best way to handle the non-supplied parameters?
> i.e. if the user selects only supplies 'Name' and 'MRN'
> I want the SQL for the stored procedure to read as if it were just 2
> parameters:
> (but have one stored procedure that has parameter holders for all 5)
> Select MRN, Name, Sex, DOB, SSN
> From Membership
> WHERE MRN = 123456 AND Name like 'Johns%'
> The way I have been handling this is to rewrite a different SQL statement
> for every possible situation, and pass that string to the adapter. But I
can
> see that I'm not taking advantage of the processing that SQL server could
do
> in a stored procedure, and for 1.4 Million records, my app is just timing
out
> all the time.
> This must be a common issue. Could someone show me the ideal way to handl
e
> this?
Have you tried something along the line of:
create procedure p_MyProc
@.pMyParm1 int = NULL, @.pMyParm2 datetime = NULL,
@.pMyParm3 varchar(128) = NULL, @.pMyParm4 bit = NULL
as
if @.pMyParm1 IS NULL do something ...
if @.pMyParm2 IS NULL do something ...
if @.pMyParm3 IS NULL do something ...
if @.pMyParm4 IS NULL do something ...|||Thank you. That was excellent.
"Roji. P. Thomas" wrote:

> Have a look at
> http://www.sommarskog.se/dyn-search.html
> --
> Roji. P. Thomas
> Net Asset Management
> http://toponewithties.blogspot.com
>
> "jonefer" <jonefer@.discussions.microsoft.com> wrote in message
> news:0FFF3A3A-AB66-4A96-B63E-73E937F7A164@.microsoft.com...
>
>|||I implemented my search with the 5 parameters using your Dynamic SQL example
.
But because of the way I want to present the final results... it always
times out.
So I will list what I'm trying to get in my final results as well as what
the Stored procedure looks like (perhaps you can help me tweak it)
What I want in the final selection:
SELECT DISTINCT MRN, MemNAME AS Member, DOB, SEX, SSN, GROUP, SGR,
[FROM-DT], [THRU-DT]
FROM qMembershipSelect AS Y
GROUP BY MRN, MemNAME, DOB, SEX, SSN, GROUP, SGR, [FROM-DT], [THRU-DT]
HAVING [THRU-DT] Is Null Or [THRU-DT] In (Select Max(X.[Thru-Dt]) From
qMembershipSelect As X Where X.MRN = Y.MRN And X.MRN Not in(Select Z.MRN
From qMembershipSelect As Z Where Z.[THRU-DT] Is Null))
ORDER BY MemNAME, [FROM-DT] DESC;
How I implemented this in the Stored Procedure:
CREATE PROCEDURE qMemberSelect
@.MRN int = NULL,
@.MemNAME nvarchar(40) = NULL,
@.DOB datetime = NULL,
@.SSN nvarchar(9) = NULL,
@.SEX nvarchar(1) = NULL,
@.debug bit = 0 AS
DECLARE @.sql nvarchar(4000),
@.paramlist nvarchar(4000)
SELECT @.sql =
'SELECT
[MRN],[MemName],[DOB],[SEX],[SSN],[GROUP
],[SGR],[FROM-DT],[THRU-DT] FROM
MEMBERSHIP AS Y
WHERE 1=1'
if @.MRN IS NOT NULL
SELECT @.sql = @.sql + ' AND MRN = @.xMRN'
if @.MemNAME IS NOT NULL
SELECT @.sql = @.sql + ' AND MemName like @.xMemNAME + ''%'''
if @.DOB IS NOT NULL
SELECT @.sql = @.sql + ' AND DOB = @.xDOB'
if @.SSN IS NOT NULL
SELECT @.sql = @.sql + ' AND SSN = @.xSSN'
if @.SEX IS NOT NULL
SELECT @.sql = @.sql + ' AND SEX = @.xSEX'
if @.debug = 1
PRINT @.sql
SELECT @.sql = @.sql + ' GROUP BY MRN, MemNAME, DOB, SEX, SSN, [GROUP], SGR,
[FROM-DT], [THRU-DT]
HAVING len([THRU-DT])= 0
Or [THRU-DT] In (Select Max(X.[Thru-Dt]) From
Membership As X Where X.MRN = Y.MRN And X.MRN
Not in(Select Z.MRN From Membership As Z Where len(Z.[THRU-DT])=0))
ORDER BY MemNAME, [FROM-DT] DESC'
SELECT @.paramlist = '@.xMRN int,
@.xMemName nvarchar(40),
@.xDOB datetime,
@.xSSN nvarchar(9),
@.xSEX nvarchar(1)'
EXEC sp_executesql @.sql, @.paramlist,
@.MRN, @.MemNAME, @.DOB, @.SSN, @.SEX
But there must be a way to do this in two phases because trying it all in
one pull is just not efficient.
"Roji. P. Thomas" wrote:

> Have a look at
> http://www.sommarskog.se/dyn-search.html
> --
> Roji. P. Thomas
> Net Asset Management
> http://toponewithties.blogspot.com
>
> "jonefer" <jonefer@.discussions.microsoft.com> wrote in message
> news:0FFF3A3A-AB66-4A96-B63E-73E937F7A164@.microsoft.com...
>
>|||How about...
SELECT MRN, Name, Sex, DOB, SSN
FROM dbo.Membership
WHERE (MRN = @.MRN or @.MRN is null)
AND (Name like @.Name or @.Name is null)
AND (Sex = @.Sex or @.Sex is null)
etc.
TIP: If there are not user specific tables, always specify the owner of the
object so that it is not ambiguous and SQL Server does not have to check for
<userid>.Membership and if not found, check for dbo.Membership. This applie
s
for referencing tables, views, and stored procedures. Also, never prefix a
stored procedure name with sp_ or xp_ as that can cause unexpected side
effects.
Just my two cents,
Joe
"jonefer" wrote:

> I have a search app that I'm developing in ASP.NET
> It has 5 parameters
> MRN, Name, Sex, DOB, SSN
> All or any combination can be used.
> what is the best way to handle the non-supplied parameters?
> i.e. if the user selects only supplies 'Name' and 'MRN'
> I want the SQL for the stored procedure to read as if it were just 2
> parameters:
> (but have one stored procedure that has parameter holders for all 5)
> Select MRN, Name, Sex, DOB, SSN
> From Membership
> WHERE MRN = 123456 AND Name like 'Johns%'
> The way I have been handling this is to rewrite a different SQL statement
> for every possible situation, and pass that string to the adapter. But I
can
> see that I'm not taking advantage of the processing that SQL server could
do
> in a stored procedure, and for 1.4 Million records, my app is just timing
out
> all the time.
> This must be a common issue. Could someone show me the ideal way to handl
e
> this?
>|||Joe
If you use sp_XXXXXX SQL server looks into MAster database first even if you
mentioned the database.sp_XXX... So, we are looking unnecessarily in master
database . that is why most folks suggest do not use sp_XXXX .I never heard
of side effects... If you know any please share with us.
--
SQL SERVER DBA
"Joe from WI" wrote:
> How about...
> SELECT MRN, Name, Sex, DOB, SSN
> FROM dbo.Membership
> WHERE (MRN = @.MRN or @.MRN is null)
> AND (Name like @.Name or @.Name is null)
> AND (Sex = @.Sex or @.Sex is null)
> etc.
> TIP: If there are not user specific tables, always specify the owner of th
e
> object so that it is not ambiguous and SQL Server does not have to check f
or
> <userid>.Membership and if not found, check for dbo.Membership. This appl
ies
> for referencing tables, views, and stored procedures. Also, never prefix
a
> stored procedure name with sp_ or xp_ as that can cause unexpected side
> effects.
> Just my two cents,
> Joe
> "jonefer" wrote:
>

Friday, February 24, 2012

Handle TEXT FIELDS in Recordset Using ASP

hi there,

I have a problem when i tried to get data from mssql server using recordset in asp language. For example, i have table containing 5 fields. One of them is text field and the rest are varchar.

here i list the table structure (table name: Info):

Field Name Field Type Length


Name varchar 50

Gender varchar 50

Address text 16

Status varchar 50

Age varchar 50


Sample data inside table info.

Name Gender Address Status Age


Ali male MAL S 26

this is my code:

set rs = server.createobject ("adodb.recordset")

rs.open "select * from info", connectionstring

if not rs.eof then

name = rs("name")

gender = rs("gender")

address = rs("address")

status = rs("status")

age = rs("age")

end if

rs.close

what happend here, i managed to get name = Ali, gender = male but for address, status and age is nothing, just empty string.What was really happened, does anyone knows this problem.

If I change

rs.open "select * from info", connectionstring

to

rs.open "select * from info", connectionstring, 3

i managed to get all the info but i have to do a lot of code change for my program. Is there any solution to this problem?

i'm using win server 2003 and mssql server 2000

thanks for cooperation from you guys.

please accept my apologize for my bad language.

regards

kharulli

Firts you need to move all your BLOB-type fields to the end of the list of your fields in a selection list of the SELECT statement. It means your SELECT should look like

SELECT [Name], Gender , Status, Age, Address FROM ....

Now, after you query data, you need to get GetChunk method of the field to read the data in a case if it is longer than 255 characters. Otherwise you could use Value property

|||

thanks VMazur for quick replies,

I tried and its works. But it seems i must do a lot code conversion to overcome this problem. Its this MSSQL weaknesses or blob-type just work like this? Does MSSQL have a solution to this problem. Sorry to cause trouble to your guys in answering my post.

best regards

kharulli.

|||I believe this is how provider handles BLOB fields. They have to be at the end of your selection. Reason for this is, probably, memory allocation|||thanks for the info. it helped me a lot.