|
hi all,
In my application vb.net 2003 and ASP.net i have to import excel sheet into sql server 2003 existing table n then into datagrid.
I have used this code but throwing an error "System.Data.OleDb.OleDbException: The Microsoft Jet database engine could not find the object. Make sure the object exists and that you spell its name and the path name correctly."
Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Team wise EMP Profile.xls") + ";Extended Properties=Excel 8.0;"
Dim objconn As New OleDbConnection(connstr)
Dim ds As New DataSet
Dim objadapter As New OleDbDataAdapter("SELECT * FROM Emp_Profile_Tbl", objconn)
Try
objconn.Open()
objadapter.Fill(ds, "nomi")
dg.DataSource = ds.Tables(0).DefaultView
dg.DataBind()
Finally
objconn.Close()
End Try
pls help me
|
|
|
|
|
sivaram praveen wrote: Server.MapPath("Team wise EMP Profile.xls")
the path of xls file or file name might be wrong..
|
|
|
|
|
Hi.
I declare a Timer object in a Module and after disabling that, when i enable it again it doesn't tick.
Please help me.
|
|
|
|
|
Hi, IIRC some timers (there are multiple timer classes) get disposed off when
you disable them. Please check the documentation.
|
|
|
|
|
Tnx for your reply. I'm using System.Windows.Forms.Timer class and i was try Stop() and Start() method but my problem is existed likewise. Please tell me how i shold perform that.
|
|
|
|
|
Hi,
the Windows.Forms.Timer is my prefered timer. The MSDN documentation says it is
single-threaded, which may mean you should do all its operations on the same thread
(i.e. creation, Start, Stop, etc) as if it were a Control.
Since it Ticks on the main or "GUI thread", my advice is to create and control it
on that thread too (e.g. in a Form_Load handler, a Button_Click handler, etc.).
BTW if this does not help, you may want to show the relevant code.
|
|
|
|
|
I have two data source tables. One is production and another is product. I would like to create a combobox in which you can choose beetwen products in products table. I have managed to do this by dragging article field from production data source table on to a windows application form and then selecting items collection for combobox from products table. Now I would like to know how can I disable editing cursor in combo box, so the users will not be able to make mistakes and could only select between shown items.
Aside that I would like to create three textbox where dimensional values would be automaticaly displayed correspondent to the product the user chooses in in combobox. The values are stored in product table database source.
To minimize code I thought I could dragg and drop textbox from from production table data source, because the program automaticaly adds buttons for saving data to this table, all I have to do is to link this three boxes to certain cells in products table. I do not know how please help.
Also I would like to do this, when i select or move with mouse over a different product in combobox I would like to have a picture of it displayed in box or frame on this windows aplication form so I could see it.
Please help if it is not to much.
|
|
|
|
|
BOREC wrote: Now I would like to know how can I disable editing cursor in combo box, so the users will not be able to make mistakes and could only select between shown items.
This is just a property on the combo box.
BTW - you really should stay on the same thread to keep talking about the same question.
BOREC wrote: Also I would like to do this, when i select or move with mouse over a different product in combobox I would like to have a picture of it displayed in box or frame on this windows aplication form so I could see it.
You can capture the mouse move and show a modeles form of your creation. The main thing is knowing which image to show.
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 )
|
|
|
|
|
Hi,
Our company has a suite of over 120 reports. I need to change the font on all of the reports from "Arial" to "Arial Unicode MS". I have a small VS2005 VB.Net app that runs through all the reports and does this. On the whole it works well, it handles charts/graphs,fields,text objects fine however I have hit one problem...changing the font on any fields/labels that are in crosstabs. Now there only a dozen or so cross tabs in the report suite but I would rather not have to do any manual editing.
I have tried accessing the crosstab both through the CrystalDecisions.CrystalReports.Engine.CrossTabObject and the CRAXDRT.CrossTabObject, neither have given me any joy.
Any suggestions/bright ideas, or am I going to have to do this manually?
Looking forward to any response
cheers
mike
|
|
|
|
|
|
Please try to use sensible subject lines. We know that this is a visual basic question, it's in the VB forum.
This is easy to do. Just select the list of fields from the database, set your combobox to have the right DisplayMember and ValueMember ( these tell the combobox which columns to use to display and as the value associated with the displayed value, usually the Id that you need to pass the selection back into the DB ), and set it's datasource to be the dataset that you got from the DB.
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 )
|
|
|
|
|
hi,
is it possible to import swf media files into my visual basic 2005???if yes, then how to implement it???...
please help me out in creating an application that has an embedded swf player...
thanks in advance!
|
|
|
|
|
VB won't do anything with them. You could include them as resources, but I have no idea if the Shockwave player will use them if stored in resources. You could include the SWF files as part of the project, then tag them as content and they'll get copied to the bin folder when you compile the app.
|
|
|
|
|
I have been building a website using ASP.NET 2.0. Also, I have a routine in Fortran, which I converted to a DLL, that I need to call from an ASP page. The problem is that the Fortran DLL returns some values to the ASP-Visual Basic code and PInvoke mechanism that I used does not like this. I get the error: PInvoke restriction: cannot return variants<.
I have tried this in Visual Basic, where the Declaration of the DLL goes on a Global.bas Module, and in that case things work. Basically my problem is that I do not know how to declare a DLL in ASP.NET so that values can be passed from the DLL to the ASP-Visual Basic code.
See my code below and thanks for any help.
Sergio
Here are the relevant sections of my code...
ASP-Visual Basic
Imports System.Diagnostics.Process
Imports System.Text.RegularExpressions
Imports System.Runtime.InteropServices
Imports System.Diagnostics
Imports System.IO
Public Class Predict
Inherits Page
Dim BethRuns As Integer 'variable to receive num of iterations
Dim AAcounter As Integer 'Amino acid counter
Dim Argument As String
Dim Seqc As String 'varible to receive the sequence from textbox
Dim i, j As Integer 'counters
Dim LengthAA As Integer 'length of the aa sequence
Dim CharAASeq As String 'Variable to store the AA string
'Declare the fortran DLL routine
Declare Auto Function segmentationAlt Lib "BETH_DLL.dll" (ByRef seq As Single, ByRef LengthAA As Integer, ByRef Top As Integer)
.
.
.
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
.
.
.
'Call the BETH DLL passing the seq array to it and the lenth of the sequence - LengthAA
'The DLL calculates the Topology - Top
'The code fails in this call and gives the error:
'"PInvoke restriction: cannot return variants"
Call segmentationAlt(seq(1), LengthAA, Top(1))
.
.
.
End sub
.
.
.
End Class
Fortran DLL
SUBROUTINE segmentationAlt(AAseqc, aaLen, top)
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'segmentationAlt'::segmentationAlt
use portlib
!********************Variables***********************************
.
.
.
end subroutine
Sergio
|
|
|
|
|
Sergio2santos wrote: Declare Auto Function segmentationAlt Lib "BETH_DLL.dll" (ByRef seq As Single, ByRef LengthAA As Integer, ByRef Top As Integer)
You haven't specified the type that is being returned by the FORTRAN funtion. There should be an As clause at the end of this function declare:
Declare Auto Function segmentationAlt Lib "BETH_DLL.dll" (ByRef seq As Single, ByRef LengthAA As Integer, ByRef Top As Integer) As whatType
I don't know FORTRAN, so I can't tell you what that should be off the top of my head.
|
|
|
|
|
Hi Dave,
Thanks for the reply. I see what you are saying.
My fortran DLL does not return values. I have it writing to memory and then the Visual Basic in ASP reads the values from that address in memory ..... the DLL writes to the variable Top as integer.
I see that I need the "AS ..." clause at the end .... I will have to figure out how to get arround this.
I have looked for a NULL return type ... but no luck.
Thank you for the help.
Best regards,
Sergio
|
|
|
|
|
Sergio2santos wrote: My fortran DLL does not return values. I have it writing to memory and then the Visual Basic in ASP reads the values from that address in memory ..... the DLL writes to the variable Top as integer.
Why?? That's doing it the hard way. If you're FORTRAN code is returning a single value, a function is the way to go.
Private Declare Function subroutineName Lib "myfortran.dll" (ByVal var As SomeType) As SomeReturnType
There is no NULL return type. This would make the method you're calling a Sub:
Private Declare Sub subroutineName Lib "myfortran.dll" (ByRef var As SomeType)
If the FORTRAN code needs to modify the variables of the caller, then the caller passes those variables in ByRef.
|
|
|
|
|
Hi Dave,
Thanks for your help. I really did not know how functions worked in Fortran - I just had to convert someone's code to a DLL and then use it inside my ASP-VB code.
However, the Fortran function on the DLL must return a one dimensional array of n values. I have been looking at "array valued functions in fortran" but I have not been able to ge it to work. Do you have any sugestions,i.e. documents websites where I can learn how to return an array from a Fortran 90 function?
Thanks and best regards,
Sergio
|
|
|
|
|
I don't know FORTRAN so I can't really help with that side. From the VB.NET side, you can declare the Function something like this, if the function returns an array of Integers:
Private Declare Function segmentationAlt Lib "myFortran.dll" ( _
ByVal AAseqc As Integer, ByVal aaLen As Integer) As Integer()
As for the FORTRAN side, Google is your friend: "fortran90 returning an array[^]". That's about the best I can do.
|
|
|
|
|
Hi Dave,
Regarding array valued functions in Fortran - I figured that if I declare my function inside the DLL as follows the DLL compiles...
FUNCTION SegmentationAlt(AAseqc, aaLen) result (top)<br />
!MS$ATTRIBUTES DLLEXPORT, ALIAS:'segmentationAlt'::segmentationAlt<br />
<br />
use portlib<br />
<br />
!********************Variables***********************************<br />
<br />
integer aaLen !The length of the aa-sequence passed<br />
integer n !Variable to store the aa-sequence length<br />
<br />
Integer AAseqc(aaLen)<br />
<br />
integer, ALLOCATABLE :: seq(:) !It will take in the amino acid input sequence -<br />
!Numeric format 1-20<br />
<br />
character topc(aaLen) !Topologia na forma I,O,M - In character format<br />
<br />
integer top(aaLen) !Sequencia de topologias relativas a seq:1(I)2(M)3(O)<br />
!In numeric format<br />
<br />
real*8 PpostT(aaLen,3), Frq(aaLen,3), FrqAnt(aaLen,3) <br />
<br />
.<br />
.<br />
.<br />
.
The return type is an integer array. And then I do not know how to call the the function from my ASP-Visual Basic. I tried "array" as return - I guess not a good idea because it is not a type but a class....
.<br />
.<br />
.<br />
Private Declare Function SegmentationAlt Lib "BETH_DLL.dll" (ByRef seq As Single, ByRef LengthAA As Integer) As Array<br />
.<br />
.<br />
.<br />
Static Top(0 To LengthAA) As Integer 'stores the numeric version of the topology<br />
.<br />
.<br />
.<br />
Top = SegmentationAlt(seq(1), LengthAA)<br />
.<br />
.
The thing actually compiles but then it does not find the function "SegmentationAlt" in the DLL.
"Unable to load DLL 'BETH_DLL.dll': The specified module could not be found. "
I am sure that the DLL was properly included in the project - I think that the "signature" of the function is not recognized from the ASP-VB code.
Could you please coment on this. I would appreciate,
Sergio
|
|
|
|
|
I have just started with VB.Net, and so far I am having a blast - however I have hit a wall with regards to the QuickTime component offered by Apple. I am posting this message here to see if anyone here has or is using it.
In the below URL (listing 3) you can see an almost perfect example of how to convert a file in VB 6 using QuickTime. I am only stuck on two issues: where / what is control.movie coming from (it's supposed to be the file you want to convert but I dont see where it is created or being passed from) and I need to get QuickTime to report back with it's export options, or the codecs which can be used to export.
http://developer.apple.com/technotes/tn2006/tn2120.html
This is technically my third program I have written so far, the second one being a total rewrite of the first. I am pretty sure the answer is right there staring me in the face, I just dont have the experiance yet to see it!
Any help at all would be greatly appreciated.
Thanks,
Mark
|
|
|
|
|
Sorikan wrote: his is technically my third program I have written so far, the second one being a total rewrite of the first.
This is something that is very basic in nature. I highly suggest picking up a beginners book on VB.NET and working through it.
The code you refer to says that "Control" is avariable of type QTControl. This method is expecting you to pass in a QTControl object.
|
|
|
|
|
Ok. Thanks for answering.
Anyone else?
Sorikan
|
|
|
|
|
I'm sure there are plenty of people here happy to back up Dave's advice. I'm one.
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 )
|
|
|
|
|
I have books, and I do use them. I have ordered more books, and will use them when they arrive.
Simply telling me to read a book in no way helps me with this specific issue. I just want to know how to export as, with quicktime in vb.net, and how to query quicktime to report back with its list of export types.
I am not asking someone else to write my entire program for me as others here do, I simply need help in one spot. Telling me to read a book (that has nothing to do with quicktime) is about as useful as not even replying to my message.
I appreciate that I am a n00b, and that I have a LOT more to learn, but I feel as if his reply was simply a blow off.
Maybe i'm just in a bad mood today. maybe not.
Sorikan
|
|
|
|