|
Hi Michael,
1.The error is raised when I call a stored procedure.
2.when I started this project, ADODB is all I knew . By the time I discovered ADO.NET I already had over 100 rutines written with ADODB. I Will eventually update the code.
Here is the Code:
Public Function Get_TransDetails(ByVal iTransId As Long, ByRef TransData As String) As System.Text.StringBuilder<br />
Dim Rs As New ADODB.Recordset()<br />
Dim Cmd As New ADODB.Command()<br />
Dim Str As New System.Text.StringBuilder()<br />
<br />
Try<br />
Verify_Connectivity()<br />
Cmd.ActiveConnection = Con<br />
Cmd.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc<br />
Cmd.Parameters.Append(Cmd.CreateParameter("TransId", ADODB.DataTypeEnum.adBigInt, 1, , iTransId)) '<-the error happens here<br />
Cmd.Parameters.Append(Cmd.CreateParameter("TransData", ADODB.DataTypeEnum.adVarChar, 2, 60, TransData))<br />
Cmd.CommandText = "[QTransDetails]"<br />
Rs.CursorType = 0 : Rs.LockType = 1 : Rs = Cmd.Execute()<br />
While Not Rs.EOF<br />
Str.Append(CType(Rs.Fields(0).Value, String).Replace(Chr(13), "") & Chr(10))<br />
Rs.MoveNext()<br />
End While<br />
Rs.Close() : WagerData = Cmd.Parameters(1).Value<br />
Return Str<br />
Catch<br />
Handle_Error(Err, "Get_TransDetails")<br />
End Try<br />
End Function
Please forgive my lack of knowledge. I have no idea what Authorization Manager is?
Again, this codes does not generate any errors when run on my XP computer, but fails when excuted in a W2000 machine. Apparently it has something to do with the Long - BigInt data types
Thanks for you time and patience.
Best Regards,
Alex.
|
|
|
|
|
alexvw wrote: Cmd.Parameters.Append(Cmd.CreateParameter("TransId", ADODB.DataTypeEnum.adBigInt, 1, , iTransId)) '<-the error happens here
Here are some possibilites that I suggest you to try..
1. What about trying to convert the variable "iTransId" to double explicitly??
eg:
Cmd.Parameters.Append(Cmd.CreateParameter("TransId", ADODB.DataTypeEnum.adBigInt, 1, , CDbl(iTransId)))
or
Cmd.Parameters.Append(Cmd.CreateParameter("TransId", ADODB.DataTypeEnum.adBigInt, 1, , CLng(iTransId)))
2. Why don't you set nothing for size parameter?? What about if you set something??
e.g.
Cmd.Parameters.Append(Cmd.CreateParameter("TransId", ADODB.DataTypeEnum.adBigInt, 1, 20 , iTransId))
3. If The two possibilities above can't solve your problem, you should probably try to convert those ADODB code to ADO.NET...
hope it helps.. let me know the result after trying those possibilities...
|
|
|
|
|
Good morning Michael,
I tried the explicit conversions.
CType(iTransId, Long) = does not work.
CType(iTransId, Double) = does the trick!
Although it works, I think I will have re-write it into ADO.NET. I am just not sure what consequences I will face in the future if I keep it this way.
To work around the issue by treating a BIGINT as a Double Precesion number does not quite make me feel confident it won't eventually fail. Moreover, it raises questions about efficient data handling.
You asked about sizing the parameter; so far, in my lack of experience, I have only needed to size string-like parametes, apparently both ADODB and ADO.NET take good care of all other data types.
Well, Thank you very much for following up my request for help. Your tip did work!
Alex.
|
|
|
|
|
alexvw wrote: Although it works, I think I will have re-write it into ADO.NET.
Yeah. man.. you should ....
alexvw wrote: To work around the issue by treating a BIGINT as a Double Precesion number does not quite make me feel confident it won't eventually fail.
ya.. I'm not sure about this too... It might be a bug or something...
alexvw wrote: I have only needed to size string-like parametes, apparently both ADODB and ADO.NET take good care of all other data types.
Yes. I think so too.. but just in case.. this is also a possibility..
alexvw wrote: Thank you very much for following up my request for help. Your tip did work!
Your welcome.. Alex..
|
|
|
|
|
Hi.How we can show header in DataList.i had given the property showheader=true,in this DataList only one column that is repeated column(3).Like Datagrid is there any propery for adding the Header.
|
|
|
|
|
The DataList is a templated control. You need to define a header template[^] to be displayed.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
I have a datagrid that has a column of links and one of these
links is clicked, a new browser window pop up and shows the aspx specified in
the link.
Thnx in Advance
|
|
|
|
|
|
how i can add scroll bars to a grid view control
|
|
|
|
|
Put it in a div and set it up to have scroll bars.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
<asp:updatepanel id="up_gv_planSpareutilise" runat="server" updatemode="Always">
<contenttemplate>
<asp:gridview runat="server" id="gv_planSpareutilise" skinid="GridViewWithOutPaging"
="" showheader="false" showfooter="false" datasourceid="ods_planSpareutilise" autogeneratecolumns="False" datakeynames="WO_ID,PK_WO_SPARE_REQD" allowpaging="false" horizontalalign="Left">
<rowstyle cssclass="row">
<headerstyle>
<columns>
<asp:boundfield datafield="PROD_NAME" readonly="True" showheader="false">
<itemstyle horizontalalign="Left" verticalalign="Middle" wrap="False" cssclass="cls_rowstyle"
="" width="122px">
<asp:boundfield datafield="QTY" readonly="True" showheader="false">
<itemstyle horizontalalign="Right" verticalalign="Middle" wrap="False" cssclass="cls_rowstyle,pad_Right10"
="" width="35px">
<asp:boundfield datafield="EST_COST" readonly="True" showheader="false" dataformatstring="{0 .00}">
<itemstyle horizontalalign="Right" verticalalign="Middle" wrap="False" cssclass="cls_itemstyle"
="" width="101px">
<emptydatatemplate>
<asp:label id="lbl_noRecordplan" runat="server" meta:resourcekey="lbl_noRecordplan"
="" width="306px" font-size="13px">
<headerstyle horizontalalign="Center">
use a div with property as style="overflow:auto" or style="overflow-x:scroll;overflow-y:scroll;" and update panel inside it and its update mode="always" it will hold its position....any more help needed reply to pratik.vishwakarma@live.in
|
|
|
|
|
hi
i got all by datatables in dt can i assign it directly to crystal reports as me code follows like this:
Dim dt As DataTable
dt = trackFac.FullReportCR()
CrystalReportViewer1.ReportSource = dt
and i wrote this in Button click event
can anybody tell is this write
Regards
padma
|
|
|
|
|
dandamudi padma wrote: Dim dt As DataTable
dt = trackFac.FullReportCR()
CrystalReportViewer1.ReportSource = dt
I don't think this is right. ReportSource of the CRV object should be a ReportDocument Object and DataSource of the ReportDocument Object should be the DataTable .
Regards - J O H N -
|
|
|
|
|
Hi all,
I am asked this question in an Interview. Add the Cart Entry in the tempory Grid which has the buttons for edit/delete.If the user add the entry then you have to show the items in the added cart and if the user want to delete then that particular row has to deleted.
I have replied that, I wil store the entry in the Gridview, when the user click the add button then add that entry(row) in the View. If the user click the click the delete button i wll remove the particular row from Gridview.
But the interviewer told that not it is not that goood way. What I did wrong heere
Thanks
Dana
|
|
|
|
|
Well, if they tell you it's not a good way, you need to ask them why they think so, and be prepared to either accept their advice, or to argue the point if you think they are wrong. What did they say the reason was ?
My main thought would be that a more lightweight control would work just fine, and a site with a shopping cart may be high traffic and concerned about server load.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
They Didnt tell any reason.But replied that we need some more points
Dana
|
|
|
|
|
OK - next time, ask. If I interviewed someone and told them their answer was wrong, and they didn't ask, that would be the end of the interview for me.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Normally here in India, If the interviewer is telling that your answer is wrong and you are asking why, then your rating of getting selected wil go low considerably.
Dan
|
|
|
|
|
Well, that's the sort of attitude that will kill people outsourcing to India, if it's not dead already. That is just dumb.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No, you are wrong. Interviewer's alway test your confidence level. You should be strong enough to ask why when they are wrong. If you are not selected it's not because you asked why, may be someone would have done better than you or you might have not performed upto their expectation...
Regards - J O H N -
|
|
|
|
|
But they have to tell the reason for not selection ?
|
|
|
|
|
hi
my project works perfectly locally before publishing the website but after that i get this error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load the assembly 'App_Web_1eiylnrk'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ control language="VB" autoeventwireup="false" inherits="index, App_Web_1eiylnrk" %>
i checked the .dll files in the bin folder and it matches the source. can you please help me out
|
|
|
|
|
Hi,
I want to specify fields from listbox that bind to table of database ,and put this specific field to ReportViewer but the problem is here:
I can't place user variety choice fields to reportviewer at run time.
I use cystalreport in visual studio 2005
|
|
|
|
|
iam working with files... i brought a file content into a textbox and i made changes to the file content now i want to save this modified file with the same name and with the same path.
|
|
|
|
|
The text file comes down from the server ? So you want to save it back to the server ? Why is the user modifying a file on the server, and why is it in the file system ? You can just get the text on postback and write it to the file.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|