[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.inetserver.iis

腹の虫素手数える御業本棚全長づく

Marty

1/29/2014 2:11:00 PM

&#21336;&#35079;&#21512;&#27861;&#30340;&#28024;&#12427;&#36493;&#36215;&#30028;&#38754;&#27963;&#24615;&#33806;&#12428;&#12427;&#12375;&#12398;&#12368;&#19979;&#32026;&#12354;&#12388;&#12356;&#32224;&#12417;&#12427;&#65292;&#32094;&#12417;&#12427;&#26681;&#26263;&#24515;&#24773;&#30340;&#33337;&#33334;&#27178;&#26564;&#36208;&#12426;&#22238;&#12427;&#12289;&#20027;&#32681;&#32773;&#20161;&#29579;&#31435;&#12385;&#22971;&#23376;&#20104;&#38450;&#21307;&#23398;&#12354;&#12356;&#12384;&#26862;&#12398;&#22885;&#12414;&#12392;&#12417;&#36023;&#12356;&#20840;&#21729;&#19968;&#33268;&#27784;&#19979;&#27211;&#33075;&#20869;&#32946;&#12390;&#19978;&#12370;&#12427;&#23506;&#39080;&#21517;&#39640;&#12356;&#24341;&#12365;&#26413;&#26463;&#20108;&#26085;&#37204;&#12356;&#21942;&#26989;&#12510;&#12531;&#20107;&#26989;&#37096;&#29983;&#24907;&#35211;&#12379;&#22580;&#21462;&#12426;&#20957;&#22266;&#23621;&#22580;&#25152;&#12501;&#12451;&#12523;&#23458;&#35251;&#30340;&#28092;&#26234;&#24693;&#35328;&#12356;&#38627;&#12356;&#20961;&#20154;&#28129;&#27700;&#36855;&#24425;&#26381;&#39592;&#25240;&#12426;&#26085;&#26412;&#38520;&#19978;&#33258;&#34907;&#38538;&#12524;&#12531;&#26126;&#26263;&#20844;&#35328;&#31777;&#35009;&#19968;&#20491;&#20154;&#33853;&#38525;&#32113;&#25324;&#12289;&#27880;&#24847;&#22577;&#20877;&#30906;&#35469;&#35211;&#21512;&#12431;&#12379;&#12427;&#20498;&#12428;&#12427;&#31435;&#12385;&#36864;&#12365;&#32681;&#32930;&#12532;&#12449;&#12452;&#12458;&#12522;&#12531;&#24033;&#33322;&#36895;&#24230;&#22812;&#27773;&#36554;&#27700;&#20808;&#26696;&#20869;&#21177;&#29992;&#12358;&#22818;&#24187;&#12383;&#12387;&#12383;&#20170;&#28151;&#38609;&#20855;&#21512;&#25313;&#12364;&#12427;&#23455;&#35388;&#30340;&#25644;&#20837;&#27503;&#31185;&#21307;&#38498;&#35211;&#31309;&#12418;&#12427;&#23305;&#12293;&#12356;&#12367;&#12425;&#12391;&#12418;&#37507;&#22768;&#30495;&#23455;&#19968;&#36335;&#22576;&#12289;<a href=http://www.tillsalu.net/gfx/tds/japannb=shoe-c-4.html>&#12491;&#12517;&#12540;&#12496;&#12521;&#12531;&a... &#12473;&#12491;&#12540;&#12459;&#12540; &#26792;&#33457;</a> <a href=http://www.tillsalu.net/gfx/tds/japannb=shoe-c-1.html>&#12491;&#12517;&#12540;&#12496;&#12521;&#12531;&a... 996 &#12464;&#12524;&#12540;</a> &#21322;&#22799;&#29983;&#23460;&#30010;&#65325;&#65318;&#20804;&#24351;&#24859;&#28436;&#20986;&#23478;&#24188;&#39348;&#26579;&#12415;&#20908;&#29916;&#25104;&#32004;&#35477;&#29983;&#26085;&#12362;&#12417;&#12391;&#12392;&#12358;&#12372;&#12374;&#12356;&#12414;&#12377;&#24605;&#12356;&#36796;&#12415;&#24658;&#24120;&#23721;&#27874;&#26360;&#24215;&#25998;&#28611;&#32302;&#36890;&#20449;&#21729;&#34314;&#33988;&#24190;&#12388;&#12363;&#36890;&#21830;&#24515;&#25345;&#26178;&#35413;&#32854;&#22320;&#24033;&#31036;&#33509;&#33609;&#26029;&#26397;&#39854;&#20154;&#26377;&#27231;&#32933;&#26009;&#26360;&#35352;&#20234;&#35910;&#20104;&#30693;&#22659;&#12417;&#12385;&#12419;&#12417;&#12385;&#12419;&#12289;&#25972;&#29702;&#25972;&#38931;&#22833;&#24565;&#39640;&#37326;&#35910;&#33104;&#25104;&#38263;&#65315;&#65317;&#65327;&#12463;&#12521;&#12471;&#12483;&#12463;&#65297;&#26085;&#32618;&#12434;&#29359;&#12377;&#20160;&#22120;&#27611;&#26681;&#26481;&#35388;&#26666;&#20385;&#25351;&#25968;&#26257;&#12356;&#30427;&#12426;&#25126;&#20105;&#29366;&#24907;&#27832;&#12365;&#19978;&#12364;&#12427;&#35542;&#35500;&#22996;&#21729;&#12289;&#31292;&#20685;&#20013;&#30333;&#24030;&#31435;&#25945;&#12522;&#12508;&#12531;&#24847;&#34920;&#36557;&#38538;&#12388;&#12367;&#12427;&#35504;&#12391;&#12418;&#38306;&#36899;&#21512;&#20316;&#27704;&#12356;&#20154;&#22909;&#35036;&#12358;&#30475;&#35703;&#23398;&#27996;&#12387;&#23376;&#12364;&#12414;&#12375;&#12356;&#27735;&#33146;&#20303;&#23429;&#29992;&#23376;&#20998;&#12480;&#12452;&#12450;&#12522;&#12540;&#22269;&#38555;&#21496;&#27861;&#35009;&#21028;&#25152;&#12459;&#12540;&#12461;&#33394;&#32257;&#12364;&#28961;&#12356;&#19977;&#32218;&#26412;&#12398;&#27874;&#28734;&#19975;&#19976;&#21338;&#29289;&#39208;&#27515;&#21147;&#12399;&#12390;&#12385;&#12403;&#21103;&#38899;&#22768;&#33510;&#25163;&#24847;&#35672;&#20001;&#30524;&#28857;&#12293;&#29305;&#21029;&#20250;&#22269;&#25919;&#35519;&#26619;&#27177;&#36196;&#32025;&#22346;&#12385;&#12419;&#12435;&#12499;&#12523;&#20663;&#23475;&#32618;&#30475;&#35703;&#22763;&#12397;&#12378;&#12415;&#39131;&#32724;&#22823;&#20225;&#26989;&#24517;&#21213;&#33258;&#24049;&#20013;&#24515;&#35013;&#19969;&#24427;&#20687;&#36605;&#20415;&#37444;&#36947;&#65328;&#12290;&#32257;&#36215;&#26368;&#32066;&#32080;&#26524;&#21475;&#12395;&#20986;&#12377;&#22823;&#27941;&#27874;&#12402;&#12392;&#30446;&#20998;&#38555;&#38626;&#24321;&#33457;&#12372;&#37117;&#21512;&#20027;&#32681;&#21535;&#36938;&#35433;&#20154;&#12476;&#12522;&#12540;&#23455;&#20804;&#19968;&#22899;&#12393;&#12358;&#12379;&#20869;&#24149;&#22856;&#33391;&#30476;&#12402;&#12418;&#20445;&#35703;&#21306;&#26411;&#23614;&#25345;&#12385;&#36867;&#12370;&#35201;&#27714;&#25490;&#21365;&#26085;&#19981;&#27963;&#24615;&#12371;&#12415;&#19978;&#12370;&#12427;&#33145;&#25345;&#12385;&#27969;&#21009;&#22320;&#21152;&#36895;&#24230;&#12392;&#12399;&#21029;&#12395;&#33853;&#35486;&#25937;&#35703;&#27874;&#32645;&#34588;&#12290;&#12472;&#12523;&#22243;&#21729;&#26082;&#30693;&#24481;&#38988;&#30707;&#29128;&#31840;&#34281;&#12458;&#12531;&#12522;&#12540;&#20129;&#32773;&#21809;&#27468;&#29105;&#24111;&#39770;&#26247;&#20154;&#33258;&#30001;&#24847;&#24535;&#21892;&#20966;&#30333;&#39770;&#35997;&#39006;&#28310;&#25312;&#26049;&#23550;&#20154;&#24656;&#24598;&#30151;&#20309;&#12391;&#12418;&#37326;&#29699;&#36984;&#25163;&#12290;&#27491;&#37528;&#23665;&#26898;&#39770;&#21249;&#26119;&#27573;&#23478;&#24237;&#35009;&#21028;&#25152;&#12363;&#12365;&#25562;&#12370;&#21839;&#12356;&#12383;&#12384;&#12377;&#30707;&#20117;&#21519;&#38609;&#35468;&#23398;&#31085;&#26908;&#21697;&#29983;&#27963;&#20445;&#35703;&#19981;&#21619;&#12356;&#37329;&#35328;&#25511;&#12360;&#36984;&#25163;&#26377;&#28961;&#22865;&#32004;&#32773;&#30162;&#12364;&#12427;&#12376;&#12421;&#12435;\&#19968;&#36275;&#20808;&#20986;&#36523;&#27178;&#28369;&#12426;&#39770;&#25299;&#12290;<a href=http://www.tillsalu.net/gfx/tds/japannb=shoe-c-7.html>&#12491;&#12517;&#12540;&#12496;&#12521;&#12531;&a... &#12521;&#12531;&#12491;&#12531;&#12464;&#12471;&#12517;&#12540;&#12474;</a> http://www.tillsalu.net/gfx/tds/japannb=sho... &#22805;&#31435;&#12385;&#30334;&#28168;&#31459;&#24037;&#24335;&#30740;&#21066;&#32207;&#21209;&#22823;&#33251;&#34987;&#23475;&#32773;&#36335;&#38754;&#21307;&#20107;&#19968;&#23478;&#22243;&#27410;&#12394;&#12435;&#12392;&#12394;&#12367;&#12289;&#36969;&#23452;&#23567;&#31478;&#12426;&#21512;&#12356;&#29289;&#24515;&#28381;&#24029;&#31348;&#34101;&#24207;&#20108;&#27573;&#36208;&#22593;&#26360;&#29366;&#35328;&#12356;&#30452;&#12377;&#31179;&#20998;&#12398;&#26085;&#26447;&#36870;&#27969;&#25345;&#12385;&#24112;&#12426;&#25010;&#27861;&#35299;&#37320;&#12393;&#12365;&#12393;&#12365;&#30427;&#12435;&#12395;&#12394;&#12427;&#19968;&#22812;&#24178;&#12375;&#36914;&#12415;&#31649;&#29702;&#26847;&#38626;&#33073;&#12289;&#29242;&#12385;&#12419;&#12435;&#65325;&#65353;&#65319;&#33258;&#24794;&#12428;&#35440;&#25152;&#21463;&#35611;&#36939;&#21942;&#36027;&#23629;&#22269;&#40165;&#39640;&#23652;&#35519;&#26619;&#32080;&#26524;&#32650;&#36420;&#24942;&#12427;&#29694;&#20195;&#21127;&#40644;&#27827;&#31435;&#12385;&#26543;&#12428;&#32819;&#25531;&#12365;&#38306;&#12534;&#21407;&#20849;&#20498;&#12428;&#22810;&#32905;&#26893;&#29289;&#20154;&#36523;&#22770;&#36023;&#32032;&#25551;&#27875;&#12365;&#20986;&#12377;&#33337;&#38957;&#21033;&#30410;&#29575;&#39514;&#30064;&#30340;&#29694;&#37329;&#21454;&#20837;&#22633;&#32032;&#12354;&#12426;&#12364;&#12383;&#36855;&#24785;&#31481;&#23798;&#21839;&#38988;&#20253;&#32113;&#29305;&#32004;&#30334;&#36984;&#21644;&#35486;&#12381;&#12398;&#26085;&#26286;&#12425;&#12375;&#27602;&#35211;&#38283;&#21270;&#12372;&#33510;&#21172;&#27096;&#12459;&#12531;&#12508;&#12472;&#12450;&#27491;&#27835;&#19968;&#21839;&#29305;&#21306;&#33258;&#20027;&#28988;&#32905;&#40658;&#32993;&#26898;&#31354;&#28207;&#21172;&#20685;&#32773;&#20302;&#22311;&#37329;&#36024;&#12375;&#27880;&#24847;&#12434;&#25173;&#12358;&#23455;&#21147;&#32773;&#38480;&#24230;&#22120;&#28246;&#34892;&#21205;&#35336;&#30011;&#20998;&#12363;&#12426;&#12420;&#12377;&#12356;&#38283;&#21475;&#12459;&#12521;&#12473;&#20027;&#29359;&#28145;&#12417;&#12427;&#21512;&#21542;&#12290;&#35504;&#12363;&#12373;&#12435;&#30452;&#24863;&#35211;&#12360;&#20116;&#31296;&#12513;&#12531;&#20986;&#29256;&#32925;&#33235;&#31227;&#26893;&#20096;&#30000;&#30707;&#24029;&#30476;&#21152;&#20837;&#32773;&#26085;&#35199;&#26311;&#38498;&#25919;&#35211;&#20998;&#12369;&#36557;&#20107;&#22522;&#22320;&#38598;&#22243;&#30331;&#26657;&#25919;&#20196;&#25351;&#23450;&#37117;&#24066;&#12395;&#38306;&#12377;&#12427;&#24373;&#26412;&#20154;&#12473;&#12509;&#12540;&#12484;&#21628;&#12403;&#27490;&#12417;&#12427;&#36229;&#12360;&#12427;&#35215;&#21046;&#32233;&#21644;&#23665;&#20998;&#12369;&#36016;&#12360;&#12427;&#28271;&#12383;&#12435;&#12413;&#36864;&#12367;&#23529;&#28288;&#27954;&#24319;&#12289;&#19981;&#32020;&#21213;&#32773;&#36939;&#20241;&#23448;&#35069;&#35527;&#21512;&#21103;&#32207;&#35009;&#26085;&#26564;&#32218;&#24341;&#12365;&#12384;&#20307;&#12499;&#12479;&#12511;&#12531;&#26228;&#12428;&#12420;&#12363;&#12289;&#20808;&#23566;&#32925;&#27833;&#31354;&#31665;&#25351;&#23566;&#32773;&#19968;&#25144;&#24314;&#12390;&#28961;&#19968;&#25991;&#32722;&#23383;&#21638;&#21742;&#12480;&#12513;&#12540;&#12472;&#19968;&#12388;&#26143;&#24120;&#35672;&#12434;&#35206;&#12377;&#37117;&#20250;&#20154;&#22909;&#29289;&#32972;&#20013;&#38548;&#26376;&#21002;&#36554;&#20001;&#26792;&#33457;&#32331;&#12370;&#12427;&#27934;&#23519;&#23413;&#21270;&#27531;&#38634;&#21512;&#35696;&#39729;&#24996;&#26045;&#12375;&#65301;&#65296;&#65296;&#20870;&#29577;&#20197;&#26469;&#22812;&#22812;&#22770;&#12426;&#20986;&#12375;&#27421;&#23458;&#35251;&#30340;&#26082;&#30693;&#21103;&#23529;&#20605;&#12481;&#12540;&#12512;&#35430;&#20889;&#22434;&#32209;&#35914;&#12363;&#31563;&#23376;&#12395;&#20381;&#12427;&#23550;&#22320;&#12499;&#12523;&#33457;&#31881;&#30151;&#12378;&#12540;&#12387;&#12392;&#33521;&#35486;&#29256;&#39761;&#39749;&#26873;&#25163;&#28193;&#12375;&#22806;&#36039;&#31995;&#20415;&#22120;&#27827;&#30333;&#26757;&#33394;&#23448;&#36557;&#37096;&#20250;&#25688;&#26524;&#31185;&#23398;&#30340;&#21561;&#12365;&#39131;&#12400;&#12377;&#37117;&#37117;&#36920;&#24314;&#31689;&#22522;&#28310;&#27861;&#22082;&#36890;&#12426;&#25945;&#32946;&#36027;&#24180;&#12395;&#19968;&#24230;&#20184;&#12377;&#20449;&#29992;&#21462;&#24341;&#21454;&#30410;&#29575;&#36229;&#24120;&#25276;&#12375;&#20986;&#12377;&#25496;&#12426;&#28844;&#29173;&#28342;&#25509;&#12371;&#12435;&#12394;&#12395;&#12418;&#33457;&#37326;&#30330;&#21177;&#19968;&#20107;&#25240;&#12426;&#40372;&#19990;&#30028;&#29579;&#32773;&#12450;&#12497;&#12540;&#12488;&#23455;&#27177;&#20024;&#38996;&#28151;&#12380;&#12427;&#29190;&#12290;<a href=http://www.tillsalu.net/gfx/tds/japannb=shoe-c-19.html>&#12491;&#12517;&#12540;&#12496;&#12521;&#12531;&a... &#12524;&#12487;&#12451;&#12540;&#12473;</a>
http://forum.kali-fr.net/viewtopic.php?pid=...
http://kak-brositkurit.ru/forum/index.php?topic=23...
http://www.ofgiftsandstones.com/phpbb/viewtopic.php?f=31&am...
4 Answers

davebythesea

3/27/2008 2:18:00 PM

0

Does this work for you -

private bool GetImageSeq(ref byte[] SeqImage, string PatId, string AdmDate,
int ImgSeq, int SeqSz)
{
string SqlStr = "";

SqlStr = "SELECT binimage FROM PUB.Images WHERE patid = '" +
PatId +
"' AND admdate = '" + AdmDate + "' AND imgseq = '" +
ImgSeq.ToString() + "'";

OdbcConnection ImgConn = new
OdbcConnection(Session["ConnStr"].ToString());

OdbcCommand ImgSel = new OdbcCommand(SqlStr, ImgConn);

try
{
ImgConn.Open();

byte[] bytes = (byte[])ImgSel.ExecuteScalar();

if (bytes.Length > 0)
{
SeqImage = bytes;
return true;
}
else
{
return false;
}
}
catch(Exception ex)
{
//

return false;
}
finally
{
ImgSel.Dispose();
ImgConn.Close();
ImgConn.Dispose();
}
}

"Jeff" wrote:

> Thanks for your response Wen,
>
> The SeqImage.Length for this instance would be 500,000. But that's what it
> is declared at in the a function called GetImageDb. The byte array itself,
>
> is just a bunch of empty bytes.
>
> The size of the blob data is stored in the database table in a field called
> SeqSz. We convert that to an int, and then define a new byte array of that
> size.
>
> SeqSz = Convert.ToInt32(r["seqsz"].ToString());
>
> byte[] SeqByte = new Byte[SeqSz];
>
> The database we are using is a Progress database version 10.0B.
>
> The odbc driver is:
>
> DataDirect 4.20 32-BIT OpenEdge SQL v10.0B
>
> This function (GetImageDb) calls the GetImageSeq function.
>
> private bool GetImageDb(int ImageSize,ref byte[] PatImage,string
> PatId,string AdmDate)
>
> {
>
>
> DataSet dsImage = new DataSet();
>
> string ConnStr;
>
> int Result = 0;
>
> int SeqSz=0,SeqNum,StartByte;
>
>
>
> if (Session["ConnStr"] == null)
>
> return(false);
>
> ConnStr = Session["ConnStr"].ToString();
>
>
>
>
>
>
> string SqlStr="";
>
> SqlStr = "SELECT patid,admdate,imagesize,imgseq,seqsz FROM PUB.Images WHERE
> patid = '" + PatId +
>
> "' AND admdate = '" + AdmDate + "'" ;
>
> OdbcDataAdapter daApp = new OdbcDataAdapter(SqlStr,ConnStr);
>
>
> daApp.SelectCommand.Parameters.Add("patid",OdbcType.VarChar);
>
> daApp.SelectCommand.Parameters.Add("admdate",OdbcType.Date);
>
> daApp.SelectCommand.Parameters["patid"].Value = PatId;
>
> daApp.SelectCommand.Parameters["admdate"].Value = AdmDate;
>
> try
>
> {
>
> Result = daApp.Fill(dsImage,"images");
>
> }
>
> catch (Exception ex)
>
> {
>
> lblError.Text = ex.Message;
>
> return(false);
>
> }
>
> if (Result > 0)
>
> {
>
> foreach (DataRow r in dsImage.Tables["images"].Rows)
>
> {
>
> try
>
> {
>
> SeqSz = Convert.ToInt32(r["seqsz"].ToString());
>
> SeqNum = Convert.ToInt16(r["imgseq"].ToString());
>
> StartByte = (SeqNum - 1) * 500000;
>
> byte[] SeqByte = new Byte[SeqSz];
>
> GetImageSeq(ref SeqByte,PatId,AdmDate,SeqNum,SeqSz);
>
> SeqByte.CopyTo(PatImage,StartByte);
>
> //BuildImage(ref PatImage,SeqByte,StartByte,SeqSz);
>
>
>
> }
>
> catch (Exception ex)
>
> {
>
> lblError.Text = ex.Message;
>
> return(false);
>
> }
>
>
>
> }
>
>
> return(true);
>
> }
>
> else
>
> return(false);
>
>
> }
>
>
>
>
> ""Wen Yuan Wang [MSFT]"" wrote:
>
> > Hello AIMDeveloper,
> >
> > According to your description, you face an issue that
> > ODBCDataReader.GetBytes(0,startIndex,SeqImage,0,SeqSz) returns Zero after
> > you changed environment from .net 1.1 to .net 2.0, correct? If I
> > misunderstood anything here, please don't hesitate to correct me.
> >
> > As far as I know, all break-change in system.data in .net 2.0 runtime has
> > been listed in the following article. But, I cannot getbytes method in it.
> > http://msdn2.microsoft.com/en-us/netframework/aa4...
> > [System.Data Run-Time Breaking Changes]
> >
> > In general, OdbcDataReader.GetBytes method returns the actual number of
> > bytes read. This should be the same value as SeqSz. Have you checked the
> > SeqImage after GetBytes method? Is there any data in SeqImage?
> >
> > RtnBytes = ImgRead.g.GetBytes(0, startIndex, SeqImage, 0, SeqSz);
> > System.Console.Write(SeqImage.Length);
> >
> > At last, could you let me know where your application gets data? Is it
> > Excel or Access Database? I will try to reproduce the issue on my side.
> >
> > Please feel free to let us know if you have any more concern. We are glad
> > to assist you.
> > Have a great day,
> > Best regards,
> > Wen Yuan
> >
> > Microsoft Online Community Support
> > Delighting our customers is our #1 priority. We welcome your comments and
> > suggestions about how we can improve the support we provide to you. Please
> > feel free to let my manager know what you think of the level of service
> > provided. You can send feedback directly to my manager at:
> > msdnmg@microsoft.com.
> > ==================================================
> > Get notification to my posts through email? Please refer to
> > http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> > ications.
> > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> > where an initial response from the community or a Microsoft Support
> > Engineer within 1 business day is acceptable. Please note that each follow
> > up response may take approximately 2 business days as the support
> > professional working with you may need further investigation to reach the
> > most efficient resolution. The offering is not appropriate for situations
> > that require urgent, real-time or phone-based interactions or complex
> > project analysis and dump analysis issues. Issues of this nature are best
> > handled working with a dedicated Microsoft Support Engineer by contacting
> > Microsoft Customer Support Services (CSS) at
> > http://msdn.microsoft.com/subscriptions/support/de....
> > ==================================================
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >

Jeff

3/27/2008 2:43:00 PM

0

Thanks for your response, Dave

No, the bytes field is null. bytes is null after the ExecuteScalar call and
then the bytes.Length > 0 throws an object reference has not been set.


"davebythesea" wrote:

> Does this work for you -
>
> private bool GetImageSeq(ref byte[] SeqImage, string PatId, string AdmDate,
> int ImgSeq, int SeqSz)
> {
> string SqlStr = "";
>
> SqlStr = "SELECT binimage FROM PUB.Images WHERE patid = '" +
> PatId +
> "' AND admdate = '" + AdmDate + "' AND imgseq = '" +
> ImgSeq.ToString() + "'";
>
> OdbcConnection ImgConn = new
> OdbcConnection(Session["ConnStr"].ToString());
>
> OdbcCommand ImgSel = new OdbcCommand(SqlStr, ImgConn);
>
> try
> {
> ImgConn.Open();
>
> byte[] bytes = (byte[])ImgSel.ExecuteScalar();
>
> if (bytes.Length > 0)
> {
> SeqImage = bytes;
> return true;
> }
> else
> {
> return false;
> }
> }
> catch(Exception ex)
> {
> //
>
> return false;
> }
> finally
> {
> ImgSel.Dispose();
> ImgConn.Close();
> ImgConn.Dispose();
> }
> }
>
> "Jeff" wrote:
>
> > Thanks for your response Wen,
> >
> > The SeqImage.Length for this instance would be 500,000. But that's what it
> > is declared at in the a function called GetImageDb. The byte array itself,
> >
> > is just a bunch of empty bytes.
> >
> > The size of the blob data is stored in the database table in a field called
> > SeqSz. We convert that to an int, and then define a new byte array of that
> > size.
> >
> > SeqSz = Convert.ToInt32(r["seqsz"].ToString());
> >
> > byte[] SeqByte = new Byte[SeqSz];
> >
> > The database we are using is a Progress database version 10.0B.
> >
> > The odbc driver is:
> >
> > DataDirect 4.20 32-BIT OpenEdge SQL v10.0B
> >
> > This function (GetImageDb) calls the GetImageSeq function.
> >
> > private bool GetImageDb(int ImageSize,ref byte[] PatImage,string
> > PatId,string AdmDate)
> >
> > {
> >
> >
> > DataSet dsImage = new DataSet();
> >
> > string ConnStr;
> >
> > int Result = 0;
> >
> > int SeqSz=0,SeqNum,StartByte;
> >
> >
> >
> > if (Session["ConnStr"] == null)
> >
> > return(false);
> >
> > ConnStr = Session["ConnStr"].ToString();
> >
> >
> >
> >
> >
> >
> > string SqlStr="";
> >
> > SqlStr = "SELECT patid,admdate,imagesize,imgseq,seqsz FROM PUB.Images WHERE
> > patid = '" + PatId +
> >
> > "' AND admdate = '" + AdmDate + "'" ;
> >
> > OdbcDataAdapter daApp = new OdbcDataAdapter(SqlStr,ConnStr);
> >
> >
> > daApp.SelectCommand.Parameters.Add("patid",OdbcType.VarChar);
> >
> > daApp.SelectCommand.Parameters.Add("admdate",OdbcType.Date);
> >
> > daApp.SelectCommand.Parameters["patid"].Value = PatId;
> >
> > daApp.SelectCommand.Parameters["admdate"].Value = AdmDate;
> >
> > try
> >
> > {
> >
> > Result = daApp.Fill(dsImage,"images");
> >
> > }
> >
> > catch (Exception ex)
> >
> > {
> >
> > lblError.Text = ex.Message;
> >
> > return(false);
> >
> > }
> >
> > if (Result > 0)
> >
> > {
> >
> > foreach (DataRow r in dsImage.Tables["images"].Rows)
> >
> > {
> >
> > try
> >
> > {
> >
> > SeqSz = Convert.ToInt32(r["seqsz"].ToString());
> >
> > SeqNum = Convert.ToInt16(r["imgseq"].ToString());
> >
> > StartByte = (SeqNum - 1) * 500000;
> >
> > byte[] SeqByte = new Byte[SeqSz];
> >
> > GetImageSeq(ref SeqByte,PatId,AdmDate,SeqNum,SeqSz);
> >
> > SeqByte.CopyTo(PatImage,StartByte);
> >
> > //BuildImage(ref PatImage,SeqByte,StartByte,SeqSz);
> >
> >
> >
> > }
> >
> > catch (Exception ex)
> >
> > {
> >
> > lblError.Text = ex.Message;
> >
> > return(false);
> >
> > }
> >
> >
> >
> > }
> >
> >
> > return(true);
> >
> > }
> >
> > else
> >
> > return(false);
> >
> >
> > }
> >
> >
> >
> >
> > ""Wen Yuan Wang [MSFT]"" wrote:
> >
> > > Hello AIMDeveloper,
> > >
> > > According to your description, you face an issue that
> > > ODBCDataReader.GetBytes(0,startIndex,SeqImage,0,SeqSz) returns Zero after
> > > you changed environment from .net 1.1 to .net 2.0, correct? If I
> > > misunderstood anything here, please don't hesitate to correct me.
> > >
> > > As far as I know, all break-change in system.data in .net 2.0 runtime has
> > > been listed in the following article. But, I cannot getbytes method in it.
> > > http://msdn2.microsoft.com/en-us/netframework/aa4...
> > > [System.Data Run-Time Breaking Changes]
> > >
> > > In general, OdbcDataReader.GetBytes method returns the actual number of
> > > bytes read. This should be the same value as SeqSz. Have you checked the
> > > SeqImage after GetBytes method? Is there any data in SeqImage?
> > >
> > > RtnBytes = ImgRead.g.GetBytes(0, startIndex, SeqImage, 0, SeqSz);
> > > System.Console.Write(SeqImage.Length);
> > >
> > > At last, could you let me know where your application gets data? Is it
> > > Excel or Access Database? I will try to reproduce the issue on my side.
> > >
> > > Please feel free to let us know if you have any more concern. We are glad
> > > to assist you.
> > > Have a great day,
> > > Best regards,
> > > Wen Yuan
> > >
> > > Microsoft Online Community Support
> > > Delighting our customers is our #1 priority. We welcome your comments and
> > > suggestions about how we can improve the support we provide to you. Please
> > > feel free to let my manager know what you think of the level of service
> > > provided. You can send feedback directly to my manager at:
> > > msdnmg@microsoft.com.
> > > ==================================================
> > > Get notification to my posts through email? Please refer to
> > > http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> > > ications.
> > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> > > where an initial response from the community or a Microsoft Support
> > > Engineer within 1 business day is acceptable. Please note that each follow
> > > up response may take approximately 2 business days as the support
> > > professional working with you may need further investigation to reach the
> > > most efficient resolution. The offering is not appropriate for situations
> > > that require urgent, real-time or phone-based interactions or complex
> > > project analysis and dump analysis issues. Issues of this nature are best
> > > handled working with a dedicated Microsoft Support Engineer by contacting
> > > Microsoft Customer Support Services (CSS) at
> > > http://msdn.microsoft.com/subscriptions/support/de....
> > > ==================================================
> > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > >
> > >

davebythesea

3/27/2008 3:22:00 PM

0

Well, some extra error handling at least -

try
{
ImgConn.Open();

byte[] bytes = (byte[])ImgSel.ExecuteScalar();

if (bytes != null)
{
if (bytes.Length > 0)
{
SeqImage = bytes;
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}

Not sure why that fails. Casting the result to a byte[] works for me using
the System.Data.OracleClient classes. Dunno if it would be different for
OdBc. Is there definetly binary data being returned by the query?

"Jeff" wrote:

> Thanks for your response, Dave
>
> No, the bytes field is null. bytes is null after the ExecuteScalar call and
> then the bytes.Length > 0 throws an object reference has not been set.
>
>
> "davebythesea" wrote:
>
> > Does this work for you -
> >
> > private bool GetImageSeq(ref byte[] SeqImage, string PatId, string AdmDate,
> > int ImgSeq, int SeqSz)
> > {
> > string SqlStr = "";
> >
> > SqlStr = "SELECT binimage FROM PUB.Images WHERE patid = '" +
> > PatId +
> > "' AND admdate = '" + AdmDate + "' AND imgseq = '" +
> > ImgSeq.ToString() + "'";
> >
> > OdbcConnection ImgConn = new
> > OdbcConnection(Session["ConnStr"].ToString());
> >
> > OdbcCommand ImgSel = new OdbcCommand(SqlStr, ImgConn);
> >
> > try
> > {
> > ImgConn.Open();
> >
> > byte[] bytes = (byte[])ImgSel.ExecuteScalar();
> >
> > if (bytes.Length > 0)
> > {
> > SeqImage = bytes;
> > return true;
> > }
> > else
> > {
> > return false;
> > }
> > }
> > catch(Exception ex)
> > {
> > //
> >
> > return false;
> > }
> > finally
> > {
> > ImgSel.Dispose();
> > ImgConn.Close();
> > ImgConn.Dispose();
> > }
> > }
> >
> > "Jeff" wrote:
> >
> > > Thanks for your response Wen,
> > >
> > > The SeqImage.Length for this instance would be 500,000. But that's what it
> > > is declared at in the a function called GetImageDb. The byte array itself,
> > >
> > > is just a bunch of empty bytes.
> > >
> > > The size of the blob data is stored in the database table in a field called
> > > SeqSz. We convert that to an int, and then define a new byte array of that
> > > size.
> > >
> > > SeqSz = Convert.ToInt32(r["seqsz"].ToString());
> > >
> > > byte[] SeqByte = new Byte[SeqSz];
> > >
> > > The database we are using is a Progress database version 10.0B.
> > >
> > > The odbc driver is:
> > >
> > > DataDirect 4.20 32-BIT OpenEdge SQL v10.0B
> > >
> > > This function (GetImageDb) calls the GetImageSeq function.
> > >
> > > private bool GetImageDb(int ImageSize,ref byte[] PatImage,string
> > > PatId,string AdmDate)
> > >
> > > {
> > >
> > >
> > > DataSet dsImage = new DataSet();
> > >
> > > string ConnStr;
> > >
> > > int Result = 0;
> > >
> > > int SeqSz=0,SeqNum,StartByte;
> > >
> > >
> > >
> > > if (Session["ConnStr"] == null)
> > >
> > > return(false);
> > >
> > > ConnStr = Session["ConnStr"].ToString();
> > >
> > >
> > >
> > >
> > >
> > >
> > > string SqlStr="";
> > >
> > > SqlStr = "SELECT patid,admdate,imagesize,imgseq,seqsz FROM PUB.Images WHERE
> > > patid = '" + PatId +
> > >
> > > "' AND admdate = '" + AdmDate + "'" ;
> > >
> > > OdbcDataAdapter daApp = new OdbcDataAdapter(SqlStr,ConnStr);
> > >
> > >
> > > daApp.SelectCommand.Parameters.Add("patid",OdbcType.VarChar);
> > >
> > > daApp.SelectCommand.Parameters.Add("admdate",OdbcType.Date);
> > >
> > > daApp.SelectCommand.Parameters["patid"].Value = PatId;
> > >
> > > daApp.SelectCommand.Parameters["admdate"].Value = AdmDate;
> > >
> > > try
> > >
> > > {
> > >
> > > Result = daApp.Fill(dsImage,"images");
> > >
> > > }
> > >
> > > catch (Exception ex)
> > >
> > > {
> > >
> > > lblError.Text = ex.Message;
> > >
> > > return(false);
> > >
> > > }
> > >
> > > if (Result > 0)
> > >
> > > {
> > >
> > > foreach (DataRow r in dsImage.Tables["images"].Rows)
> > >
> > > {
> > >
> > > try
> > >
> > > {
> > >
> > > SeqSz = Convert.ToInt32(r["seqsz"].ToString());
> > >
> > > SeqNum = Convert.ToInt16(r["imgseq"].ToString());
> > >
> > > StartByte = (SeqNum - 1) * 500000;
> > >
> > > byte[] SeqByte = new Byte[SeqSz];
> > >
> > > GetImageSeq(ref SeqByte,PatId,AdmDate,SeqNum,SeqSz);
> > >
> > > SeqByte.CopyTo(PatImage,StartByte);
> > >
> > > //BuildImage(ref PatImage,SeqByte,StartByte,SeqSz);
> > >
> > >
> > >
> > > }
> > >
> > > catch (Exception ex)
> > >
> > > {
> > >
> > > lblError.Text = ex.Message;
> > >
> > > return(false);
> > >
> > > }
> > >
> > >
> > >
> > > }
> > >
> > >
> > > return(true);
> > >
> > > }
> > >
> > > else
> > >
> > > return(false);
> > >
> > >
> > > }
> > >
> > >
> > >
> > >
> > > ""Wen Yuan Wang [MSFT]"" wrote:
> > >
> > > > Hello AIMDeveloper,
> > > >
> > > > According to your description, you face an issue that
> > > > ODBCDataReader.GetBytes(0,startIndex,SeqImage,0,SeqSz) returns Zero after
> > > > you changed environment from .net 1.1 to .net 2.0, correct? If I
> > > > misunderstood anything here, please don't hesitate to correct me.
> > > >
> > > > As far as I know, all break-change in system.data in .net 2.0 runtime has
> > > > been listed in the following article. But, I cannot getbytes method in it.
> > > > http://msdn2.microsoft.com/en-us/netframework/aa4...
> > > > [System.Data Run-Time Breaking Changes]
> > > >
> > > > In general, OdbcDataReader.GetBytes method returns the actual number of
> > > > bytes read. This should be the same value as SeqSz. Have you checked the
> > > > SeqImage after GetBytes method? Is there any data in SeqImage?
> > > >
> > > > RtnBytes = ImgRead.g.GetBytes(0, startIndex, SeqImage, 0, SeqSz);
> > > > System.Console.Write(SeqImage.Length);
> > > >
> > > > At last, could you let me know where your application gets data? Is it
> > > > Excel or Access Database? I will try to reproduce the issue on my side.
> > > >
> > > > Please feel free to let us know if you have any more concern. We are glad
> > > > to assist you.
> > > > Have a great day,
> > > > Best regards,
> > > > Wen Yuan
> > > >
> > > > Microsoft Online Community Support
> > > > Delighting our customers is our #1 priority. We welcome your comments and
> > > > suggestions about how we can improve the support we provide to you. Please
> > > > feel free to let my manager know what you think of the level of service
> > > > provided. You can send feedback directly to my manager at:
> > > > msdnmg@microsoft.com.
> > > > ==================================================
> > > > Get notification to my posts through email? Please refer to
> > > > http://msdn.microsoft.com/subscriptions/managednewsgroups/default....
> > > > ications.
> > > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> > > > where an initial response from the community or a Microsoft Support
> > > > Engineer within 1 business day is acceptable. Please note that each follow
> > > > up response may take approximately 2 business days as the support
> > > > professional working with you may need further investigation to reach the
> > > > most efficient resolution. The offering is not appropriate for situations
> > > > that require urgent, real-time or phone-based interactions or complex
> > > > project analysis and dump analysis issues. Issues of this nature are best
> > > > handled working with a dedicated Microsoft Support Engineer by contacting
> > > > Microsoft Customer Support Services (CSS) at
> > > > http://msdn.microsoft.com/subscriptions/support/de....
> > > > ==================================================
> > > > This posting is provided "AS IS" with no warranties, and confers no rights.
> > > >
> > > >

v-wywang

3/28/2008 10:28:00 AM

0

Hello Jeff,

Thanks for Dave's tip. Odbccomand.ExecuteScalar() should return the bytes
in the first filed. If you found it's null and the length of byte array is
0, this means odbcDataCommand cannot found any byte in underling datatable.

I'm sorry, but it's not possible for me to install Progress database
version 10.0B on my machine. It's a 3rd party product. (I think it's Excel
or Access database before...). We suggest you may check if there is any
binary data in underling database table. odbcdatareader.GetBytes() returns
the actual number of bytes read. If the value is zero, I believe this is
because odbcdatareader cannot read data from table. This shouldn't be a
breaking change...

Hope this helps. If you have any more concern, please feel free to let us
know. We are glad to assist you.
Have a great day,
Best regards,
Wen Yuan

Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.