|
thanks for the advise but i am still blur. i know is tis line "strActionName1 = dTable.Rows(0)("ActionName")" which is the cause of the error but i do not know how to debug the error.My DB is empty for the start and i am not suppose to hardcode any data into the DB. but after it is use once i need to check if the record exist so there wont be any repeat record and so i cant use insect only. Any idea in what i can do to debug tis error?
|
|
|
|
|
Subjugate wrote: "strActionName1 = dTable.Rows(0)("ActionName")"
I may not be able to advise you how to debug it since I dont know where the code resides, the general architecture etc.
However, you can test dTable.Rows(0)("ActionName") for DBNull by
IsDBNull(dTable.Rows(0)("ActionName")), if it is, assign
strActionName1 = ""
Please note that it is always good to assume that anything coming from the DB maybe null.
Hope this helps.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
i tried using IsDBNull(dTable.Rows(0)("ActionName")) but the ans is false and i oso tried to assign strActionName1 = "" but it just pop out the same error. So confused dun know where is the fault.
|
|
|
|
|
Can we see the entire code?
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
the entire code of the button i already paste it on the 1st forum already.. or wat entire code u referring to?
|
|
|
|
|
You said that you had checked for IsDBNull etc. can you please post the updated code.
Also, why cannot you debug successfully?
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Hi,
strActionName1 = dTable.Rows(0)("ActionName")
here you should use like
strActionName1 = trim(dTable.Rows(0)("ActionName") & " ")
OR
before assigning value from db to string check for null
Regards,
S Kumar
|
|
|
|
|
thanks a lot man.. the error does not occur again..
|
|
|
|
|
how to get a height of details section in crystal report.
i.e. total height covered by all records.
i m having crystal report 9.0 and have a report containing item description whose name lenght is not fixed.
so height of each record depends on height of item description field.
how can i get height of details section after formatting details section ?
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
I have link my SQL in my data enviroment on running some procedure.
But how can i should those SQL result at my data grid?? i have set data resource to my data enviroment but when i run it, it was blank..?? only the Column title but data was blank..?
|
|
|
|
|
post the code where your binding the data to the datagrid. Sounds like you've assigned the data source but never bind it. Or the data source is sending you no data.
|
|
|
|
|
no code all in properties.
DATAGRID properties i set:
DATAsource: dataenvoriment1
datamember: command1
when i try to retrieve, yes the column title data show out.
when i try to run it suppose the datagrid will show some data but it's blank.
About my SQL is correct cause b4 that i use ADODC1 to link to datagrid and show the data show correctly. but when i try to use dataenviroment it not showing data out.
|
|
|
|
|
when the datagrid is needing to be displayed you'll need to execute the data command and bind the data to the datagrid. IE...
DataGrid1.DataSource = dataenvoriment1<br />
DataGrid1.DataMember = command1<br />
DataGrid1.DataBind()
|
|
|
|
|
wat do i need to type after
DataGrid1.DataBind() = ??????
|
|
|
|
|
|
have you checked you table contents ?
data is blank or not ?
and in dataenvironment->go to connection->test connection
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
|
what kind of command you are using for retrieving data ?
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
I want to read a picture in JPEG format from MS WOrd document and display it in VB, any body know how to do it ?
Thanks in advance for help !
|
|
|
|
|
try this
objWD.ActiveDocument.Shapes(ii).Select
objWD.Selection.CopyAsPicture
where objwd is object refereced to word application.
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
I have windows form (vb.net) in which i have webbrowser control. Now when i open up some web site at runtime in that form, i need to capture the onblur and onfocus events of my input boxes on an html form and perform custom external handling in my vb.net application. I have been able to successfully hook up a handler to the 'onclick' event, but the 'onblur' events are not working. Can anybody please tell me why is it happening?
i have picked up an input box and then attaching an evenhandler using
AddHandler CType(txt, mshtml.HTMLInputTextElementEvents2_Event).onblur, AddressOf Me.txt2_HTMLInputTextElementEvents_Event_onblur
and the correspoding handler is like this.
Private Sub txt2_HTMLInputTextElementEvents_Event_onblur(ByVal pEvtObj As mshtml.IHTMLEventObj)
.....................
........some code will go here .......
.....................
End Sub
|
|
|
|
|
i haveing an error while running my coding which is to pass the info from the data grid to EXCEL... it pass correctly at first but when it try to pass the last 3 row then error pops up : Runtime error '6148' invalid row number. when i try to check my excel the last print out b4 error happen,it refer to the data grid last row info which mean it try to skip to the last row... so when the system try to read next time there was no more line to read... i have check my code many time i dunno y the vb just skip the line itself....
For example again: datagrid row 10 = EXCEL row 10 but the EXCEL row 10 have print out datagrid row 20...
i = 3 'ROW<br />
j = 2 'Column<br />
For dr = 0 To (Adodc1.Recordset.RecordCount - 1)<br />
For dc = 0 To (DataGrid1.Columns.Count - 1)<br />
<big>DataGrid1.Row = dr</big><br />
DataGrid1.Col = dc<br />
ApExcel.Cells(i + 1, j).Value = DataGrid1.Text 'Pass info from data grid to EXCEL<br />
j = j + 1<br />
Next dc<br />
j = 2<br />
i = i + 1<br />
Next dr
|
|
|
|
|
use :-
For dr = 0 To (Adodc1.Recordset.RecordCount - 1)
For dc = 0 To (DataGrid1.Columns.Count - 1)
DataGrid1.Row = dr+1 ' as 0 is not a valid row
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|
|
i run ok for the 0 which mean the first line.
when it go to the 11 line then something goes wrong with the data it will get the last value of the data. u know wat i mean? when it get the last data of the last row but which is not. when it go to the next row, there is nothing to get so error came out.
But i didnt control the VB to skip the 11 line...
|
|
|
|
|
on which line and text error occurs ?
either datagrid1.text or other ?
IT IS NOT AS IMPORTANT AS WHETHER YOU SUCCEED OR FAIL BUT WHAT IMPORTANT IS THAT YOU TRY YOUR BEST.
SO ALWAYS TRY AT YOUR LEVEL BEST
|
|
|
|