|
Dave, Thanks, I just do not have the time I am a newbie so it will take me lots of time, so I have again visited Rentacoder, all is well and thank you again, Just for my own knowledge I will browse the web,
Simon
simon
|
|
|
|
|
Good Luckk with that!
|
|
|
|
|
Hi. I'm busy with a app that needs to print xml rendered by xslt. Currently I am printing with internet explorer in the following manner
<pre>
Dim internetExplorer As New SHDocVw.InternetExplorerClass() Dim webBrowser As SHDocVw.IWebBrowser2 = CType(internetExplorer, SHDocVw.IWebBrowser2) 'Make the web browser visible webBrowser.Visible = False 'Display empty page so we have something to manipulate. Dim noValue As Object = System.Reflection.Missing.Value webBrowser.Navigate("file://" + fileName, noValue, noValue, noValue, noValue) While webBrowser.Busy Threading.Thread.Sleep(500) End While 'Get access to the webbrowser's document. internetExplorer.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, noValue, noValue) 'CType(internetExplorer.Document, mshtml.IHTMLDocument2).close() Marshal.ReleaseComObject(internetExplorer) Marshal.ReleaseComObject(webBrowser)
</pre>
I need to find a different way to do this as the above code gives a com exception. Or I need a workaround for the above code. If anybody can help I would greatly appreaciate it.
Stephen
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Don't repeat the same question again and again in the same day. You just posted this 7 hours ago and haven't waited long enough for a response. I just started playing around with your code, not 2 minutes ago and need time to look it the problem.
|
|
|
|
|
Sorry I just under presure to get an answer for this. Any luck so far because I am stuck
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Yeah, and I'm under pressure to test 96 applications by the end of this week...
CodeProject is supported entirely by people who volunteer their time. We get around to answering questions as much as we can whenever we can, but on our own time. We don't get paid to do this.
|
|
|
|
|
Dear All,
I am looking for to convert code of C# to VB.net is any possibility or guideline then please guide me.
Thanks
Sajjad Ali
|
|
|
|
|
It's not that different.
You can find "Resetta Stone" examples all over MSDN's documentation for the .NET Framework. There are line-for-line translations in C++, VB.NET, C# for most of the examples.
There are also online translation utilities. Just Google for "Convert C# to VB.NET code".
|
|
|
|
|
|
Hello all,I'm new to using Crystal Reports and VB.NET Programming here. I have try to Google for how it works. Currently I'm able to show my Blank Reports by Clicking a Button2. I have to ask anyone can tell me how to display my data using the Crystal Report? The following are the code I'm currently working with:
'When the following button Click,the Report will showout.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim objRpt As New FrmCrystalRpt
objRpt.strRptName = New CachedCrystalReport1
objRpt.Show()
End Sub
'The below is my ReportViewer WinForm
Public Class FrmCrystalRpt
Public strRptName As Object
Public strRptFilter As String
Private Sub FrmCrystalRpt_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If strRptFilter <> "" Then
crptVW.SelectionFormula = strRptFilter
End If
crptVW.ReportSource = strRptName
crptVW.Show()
End Sub
End Class
Currently my report showing nothing,I'm wondering how could I make this report show my selection of data from the MySQL5.0 database?
I'm using MySQL ODBC3.51 Driver to connect my Database=logistic_sysdb.
I wish the Crystal Report can show my selection of data below:
Dim SQL4 As String
selectmonth = ComboBox2.SelectedItem
SQL4 = "SELECT * FROM lorry_commission WHERE Lorry_No='" & ComboBox1.SelectedItem & "' AND MONTH(Date)='" & selectmonth & "';"
Try
ObjMyConn.Open()
ObjAdapter = New MySqlDataAdapter(SQL, ObjMyConn)
ObjAdapter.Fill(ds, "Salary44")
Catch ex As Exception
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly)
Finally
ObjMyConn.Close()
End Try
I guess some parameter is needed to be passed into the Crystal Report as well. How to do that?
Anyone can give me a sample is better so I can learn easier to solve this.
Thanks for reading.
Drex
|
|
|
|
|
You would need to assign a DataSource to the report. Take a look at this article [^]
|
|
|
|
|
I'm still wondering how to use that Crystal Report? Anyone can let me know how to show a dataset table result using a Crystal Report after clicking a button? And how can I pass 3 string parameter to the Crystal report?
Thanks for reading.
Drex
|
|
|
|
|
Hi
I need help regarding the cell formatting event for the datagridview control in windows forms. I looked on the web and I cannot seem to find a perfect solution for this.
I am using VS 2008 and code in VB.NET.
I have a datagridview with many fields amongst which I have an Effective from date.
If the effective from date is smaller than today’s date certain fields should be disabled and made a funny color.
Private Sub DGV1_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles DGV1.CellFormatting
Try
If e.RowIndex >= -1 And e.RowIndex <= DGV1.RowCount Then 'Basic index validation
If Not ((DGV1 Is Nothing) OrElse (DGV1.Rows(e.RowIndex) Is Nothing) OrElse (DGV1.Rows(e.RowIndex).DataBoundItem Is Nothing)) Then
Dim dgvRowState As DataRowState = DirectCast(DGV1.Rows(e.RowIndex).DataBoundItem, DataRowView).Row.RowState
'The idea here is to check that it is only for Non Added/Detatched rows where the Effective From Date is smaller than today
If Not (dgvRowState = DataRowState.Added OrElse dgvRowState = DataRowState.Detached) _
AndAlso e.ColumnIndex = EffectFromDataGridViewTextBoxColumn.Index AndAlso CDate(e.Value).Date < Date.Now.Date Then
e.CellStyle.BackColor = My.Settings.ReadOnlyColor
DGV1.Rows(e.RowIndex).Cells(e.ColumnIndex).ReadOnly = True
DGV1.Rows(e.RowIndex).Cells(Field1.Index).ReadOnly = True
DGV1.Rows(e.RowIndex).Cells(Field2.Index).ReadOnly = True
DGV1.Rows(e.RowIndex).Cells(Field1.Index).Style.BackColor = My.Settings.ReadOnlyColor
DGV1.Rows(e.RowIndex).Cells(Field2.Index).Style.BackColor = My.Settings.ReadOnlyColor
DGV1.Rows(e.RowIndex).Cells(e.ColumnIndex).Style.BackColor = My.Settings.ReadOnlyColor
End If
End If
End If
Catch ex As IndexOutOfRangeException
Exit Sub 'Exception added to aviod the following behaviour... When the user adds a new line enters a value and use the mouse to
' navigate to another line, the current new row will be cleared and the cellEndEdit event will be fired. inwhich case the DGV contains
' a blank row that is not dirty. The row "DGV1.Rows(RowIndex).DataBoundItem" part gives an exception for this row
End Try
This works well…
But the problem I am having is when I go to a row where the Effective from date is greater than today and where cells is not read only and change the effective from date to the past that row also changes.
I don’t want this to happen until the user presses on the save button. I debugged the code and found that the dgvRowState variable = UNCHANGHED . Thus it never reaches ADDED or DETATCHED .
Is the way I determine the rowstate wrong? Or is there another way to do this?
Thanks,
Chris
|
|
|
|
|
How to check whether a particuar file exists on FTP server through VB.Net?
|
|
|
|
|
Did you even bother to look at the other answers given when you asked this SAME question just a few posts down? You're off to a bad start.
|
|
|
|
|
--> i want to use SQL SERVER 2000 on windows vista... but it gives me a login error... remember that the sql server is on local system.... i am providing the following connection string from vb.net 2005.....
"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSM;Data Source=."
--> but when i use this on windows XP... it works smoothly....
--> plz solve my problem.... thanx....
J A Nasir K
|
|
|
|
|
Is your SQL Server setup to use Windows Authentication?? Have you setup your account in the SQL Server??
This question really has nothign to do with VB.NET and should be in the General Database forum.
|
|
|
|
|
--> are you connecting to an instance? try connecting to:
"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CSM;Data Source=.\SQLEXPRESS"
--> did you check the settings? (like, allow remote connections and stuff?)
--> it don't make a dif'rence whether it's XP or Vista.
I are troll
|
|
|
|
|
You may also want to read some articles on using SQL Server 2000 on Vista. Google results[^] Using 2000 on Vista is not without it's problems...
|
|
|
|
|
I have .CSV file on my machine. That file doesn't exist on FTP server.i have to write a code in vb.net which checks if the file doesn't exist on server, then only FTP the file.
I have written a small code that does simple FTP and not checks existance of the file on server.
Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://127.0.0.1/Book1.csv"), System.Net.FtpWebRequest)
clsRequest.Credentials = New System.Net.NetworkCredential("me", "test")
clsRequest.Method = System.Net.WebRequestMethods.Ftp.UploadFile
clsRequest.KeepAlive = False
clsRequest.UseBinary = True
' read in file...
Dim bFile() As Byte = System.IO.File.ReadAllBytes("C:\FTP\Book1.csv")
' upload file...
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() -- the Code gives error here
clsStream.Write(bFile, 0, bFile.Length)
clsStream.Close()
clsStream.Dispose()
Can you please help me.
|
|
|
|
|
I use this simple code
Try
My.Computer.Network.UploadFile(f.Local, f.FTP.ToLower, .Login, Functions.fEncode(.Paswoord))
Catch ex As Exception
sError = ex.Message
sMessage = ex.Message
End Try
I think its easy to transform
the vars sError and sMessage are there becourse I use them later to show all errors in one message
Jan
|
|
|
|
|
The problem with the code above :
DirectCast(System.Net.WebRequest.Create("ftp://127.0.0.1/Book1.csv"), System.Net.FtpWebRequest)
is that Book1.csv doesn't exist on server. So in code line:
Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream()
when it try to read the stream, it doesn't find the file and gives error "the File does not exist"
|
|
|
|
|
hi,
you can use this: http://www.codeproject.com/KB/IP/FTP_Secure.aspx[^]
it's An FTP secure client library for C# (NOT VB.Net sorry)!
to checks existance of the file on server:
FTPFactory ff = new FTPFactory();
ff.setDebug(true);
ff.setRemoteHost(Settings.Default.SourceFtpHost);
ff.setRemoteUser(Settings.Default.SourceFtpUser);
ff.setRemotePass(Settings.Default.SourceFtpPass);
ff.login();
ff.chdir("in");
string[] fileNames = ff.getFileList(string FileMask));
if (fileNames == null || fileNames.Length == 0)
{
throw new Exception("No File was found");
}
|
|
|
|
|
Hi. I'm busy with a app that needs to print xml rendered by xslt. Currently I am printing with internet explorer in the following manner
Dim internetExplorer As New SHDocVw.InternetExplorerClass()
Dim webBrowser As SHDocVw.IWebBrowser2 = CType(internetExplorer, SHDocVw.IWebBrowser2)
'Make the web browser visible
webBrowser.Visible = False
'Display empty page so we have something to manipulate.
Dim noValue As Object = System.Reflection.Missing.Value
webBrowser.Navigate("file://" + fileName, noValue, noValue, noValue, noValue)
While webBrowser.Busy
Threading.Thread.Sleep(500)
End While
'Get access to the webbrowser's document.
internetExplorer.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, noValue, noValue)
'CType(internetExplorer.Document, mshtml.IHTMLDocument2).close()
Marshal.ReleaseComObject(internetExplorer)
Marshal.ReleaseComObject(webBrowser)
I need to find a different way to do this as the above code gives a com exception. Or I need a workaround for the above code. If anybody can help I would greatly appreaciate it.
Stephen
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
how to bind checkedlistbox with dataset in vb.net (window application)
Er. Jagwinder Singh
|
|
|
|