|
Excume, but I don't see your command, or connection? where is you data comming from?
|
|
|
|
|
Oh, it is coming from my dataset object SQL server. Here is my connection:
Provider=SQLOLEDB;Data Source=main;Integrated Security=SSPI;Initial Catalog=SpringBooking
|
|
|
|
|
That's OK but I what I need is too see where in your code you are setting this code, your command will help too. But as I already said I need to see in which event and what code you have there to make this works...
|
|
|
|
|
I am trying to pull out info with an SQL statement, and order it by date before it arrives at my datagrid.
sComm += "SELECT Fixtures.HomeTeam, Fixtures.AwayTeam, Fixtures.Date FROM Fixtures WHERE (Fixtures.HomeTeam ='" + TName + "' or Fixtures.AwayTeam = '" + TName + "')ORDER BY Fixtures.Date"
It keeps giving me the error:
Syntax error (missing operator) in query expression 'Fixtures.DateSELECT Fixtures.HomeTeam'.
Cheers.
|
|
|
|
|
Ok, let's try first with everything hardcode, can you this pls:
" SELECT Fixtures.HomeTeam, Fixtures.AwayTeam, Fixtures.[Date] "+
" FROM Fixtures WHERE (Fixtures.HomeTeam =' TName ' OR Fixtures.AwayTeam = ' TName ' ) "+
" ORDER BY Fixtures.[Date] "
If this works then you have data problem a not..
|
|
|
|
|
I am sooooo dumb. Do you know what my problem was. I had messed about with the button that called the fuction. And I forgot to remove something, and it was calling the fuction twice.
Which is why I was getting "Syntax error (missing operator) in query expression 'Fixtures.DateSELECT Fixtures.HomeTeam'."
'Fixtures.DateSELECT Fixtures.HomeTeam'."
Because this..^ is where the first call ends and the other begins.
DOH'
Thanks anyway, its working now.
|
|
|
|
|
My first question has to be, what is in sComm before you this assignment. You are concatinating the select command to the value in sComm, so if sComm contains "Fixtures.Date", then you will end up with
"Fixtures.DateSELECT Fixtures.HomeTeam, Fixtures.AwayTeam, Fixtures.Date FROM Fixtures WHERE (Fixtures.HomeTeam ='" + TName + "' or Fixtures.AwayTeam = '" + TName + "')ORDER BY Fixtures.Date"
and of course this is not a proper sql command.
I would suggest changing
sComm += "SELECT Fixtures.HomeTeam, Fixtures.AwayTeam, Fixtures.Date FROM Fixtures WHERE (Fixtures.HomeTeam ='" + TName + "' or Fixtures.AwayTeam = '" + TName + "')ORDER BY Fixtures.Date"
to
sComm = "SELECT Fixtures.HomeTeam, Fixtures.AwayTeam, Fixtures.Date FROM Fixtures WHERE (Fixtures.HomeTeam ='" + TName + "' or Fixtures.AwayTeam = '" + TName + "')ORDER BY Fixtures.Date"
Hope this helps.
Roy.
|
|
|
|
|
I want to merge 6 pdf files to a single pdf file. i am
working with vb.net, can u please suggest any method
to achieve this using vb.net, pls help me
|
|
|
|
|
I want to have basic knowledge of password hacking , the logic involved , the concept involved behind the hacking . if any one can provide me with a sample code i will be very greatfull.
Thank you
|
|
|
|
|
I hope nobody gives you a serious answer to this, as the subject is not one that I think is accepable on this forum.
There are many many resources online for this sort of thing, CP is not one of them.
|
|
|
|
|
<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Dim LocationOfOsamaBinladen as string<br />
Dim OsamaBinladensPasswordToBankAccount as string<br />
<br />
LocationOfOsamaBinladen = FindOsamaBinLaden(try-hard)<br />
OsamaBinladensPasswordToBankAccount = GetOsamaBinLardensPassword(try-even-harder)<br />
<br />
SendPasswordTo("KiloDunse**DK**")<br />
SendLocationTO("U.S Goverment")<br />
<br />
End Sub<br />
<br />
<br />
Private Function FindOsamaBinLaden(level-of-commitment) as String<br />
...<br />
End Function<br />
<br />
Private Function GetOsamaBinLardensPassword(level-of-commitment) as String<br />
...<br />
End Function<br />
Any questions?... don't ask me!
Programming is like Mathematics… you take ONE step at the time!
|
|
|
|
|
Hello,
I'm making a program that make use of Excel. In it, I create an Excel application and then make it visible, then perform several operations with it. Up to this point, everything OK.
The problem comes when I try to close the Excel. At first I thougt that, being an object created within my app, the process will be destroyed by the garbage collector. Then I realized that not. I tried to use the ExcelApp.Quit() method, but it doesn't work either.
In conclusion, I find myself with my program closed, but with a residual Excel process within an SVCHOST parent process I can't kill. Things turn to worse when I execute my app several times: I end up with several Excel processes, consuming no less than 8MB of memory each!!!
I invoke the Excel with the following code:
Imports Microsoft.Office.Interop.Excel
...
Private Excel As New Microsoft.Office.Interop.Excel.Application() ' el Excel
What can I do? Any help will be welcomed!
Thanks in advance,
Juan Pedro Pérez
|
|
|
|
|
Give this a try when you are done using Excel:
' Release Application object:
If Not oExcel.UserControl Then oExcel.UserControl = True
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcel)
'Release worksheet:
If Not oWorkSheet Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorkSheet)
oWorkSheet = Nothing
End If
'Release workbook:
If Not oWorkBook Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorkBook)
oWorkBook = Nothing
End If
oExcel = Nothing
oExcel is your Excel application object.
oWorksheet is your Excel worksheet object if you have one instantiated.
oWorkbook is your Excel workbook object if you have one instantiated.
Dean
|
|
|
|
|
Thanks Dean, I'll try this and I'll tell you how it works.
Juan Pedro Pérez
|
|
|
|
|
Hai,
I am facing the following problem when I am doing with my vb project,
In my program I need to copy files from Server to client. If client is not having sufficient privilages, then it should prompt for admin account and copy it in admin account.
When I try to copy a file through user account insufficient privilage message ,I got.
Through net ,I found that we can do it using 'Run as' command.
But i don't have clear idea to use it in VB.
Can anybody help me to show the right way to do this?
Thanks very much in advance.
Thank You,
rahul.p.menon
|
|
|
|
|
I've developed a website thro' and i'd like to see the suggestions of the users.
For that purpose i'd like to get the feedback from the users once they fill in the form.
The feedback must be sent to my email id automatically from the filled in information
when i tried i got the following error.................................
----------------------------------------------------------
the code goes like this
----------------------------------------------------------
Dim myMailServer As SmtpMail
myMessage.BodyFormat = MailFormat.Text
myMessage.Priority = MailPriority.High
myMessage.From = "xyz@urdomain.com" 'From Address
myMessage.To = "mymailid@mydomain.com" 'To Address
myMessage.Subject = "hi"
myMessage.Body = "hello"
myMailServer.SmtpServer = "smtp.net4india.com"
'This is my mail server
myMailServer.Send(myMessage)
myMessage = Nothing
----------------------------------------------------------
error msg is like this
----------------------------------------------------------
The transport failed to connect to the server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The transport failed to connect to the server.
Source Error:
Line 103: myMailServer.SmtpServer = "smtp.net4india.com" 'This is my mail server '
Line 104: myMailServer.Send(myMessage)
|
|
|
|
|
The SmtpServer property and Send method are static. Don't use a reference.
SmtpMail.SmtpServer = "smtp.net4india.com"<br />
SmtpMail.Send(myMessage)
---
b { font-weight: normal; }
|
|
|
|
|
You have not created the object myMailServer . You have just declared it
Divya Rathi
|
|
|
|
|
! Hello everyone,
I need help.
I want to get the filestream or memorystream from Image Object.
Dim img As Image
Dim path As String = "temp"
Dim fs As IO.FileStream
Dim br As IO.BinaryReader
Dim bytes() As Byte
Dim sqlImg As SqlTypes.SqlBinary
Try
img = picPhoto.Image
img.Save(path)
fs = New IO.FileStream(path, IO.FileMode.Open, IO.FileAccess.Read)
br = New IO.BinaryReader(fs)
bytes = br.ReadBytes(fs.Length)
sqlImg = New SqlTypes.SqlBinary(bytes)
SQL_Parameter(i).Value = sqlImg
'Save Image to Sql Database
Catch ex As Exception
Throw ex
Finally
If Not br Is Nothing Then
br.Close()
br=Nothing
End If
If Not fs Is Nothing Then
fs.Close()
fs = Nothing
End If
bytes = Nothing
img.Dispose()
sqlImg = Nothing
End Try
'It is working but sometime throw the error
' A generic error occurred in GDI+
'Thanks.
!alien!
|
|
|
|
|
Try using Save method.
Nibu thomas
Software Developer
|
|
|
|
|
This code will convert any imageformat to a MemoryStream.
<br />
Imports System.Drawing.Imaging<br />
Imports System.IO<br />
<br />
Public Class Form1<br />
<br />
Public JpegStream As MemoryStream<br />
Public myImageCodecInfo As ImageCodecInfo = GetEncoderInfo("image/jpeg")<br />
Public myEncoder As Encoder<br />
Public myEncoderParameter As EncoderParameter<br />
Public myEncoderParameters As EncoderParameters<br />
<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Dim filename As String = "C:\test.jpg"<br />
Dim Bmp = New Bitmap(filename)<br />
JpegStream = Nothing<br />
JpegStream = New MemoryStream<br />
<br />
Bmp.Save(JpegStream, myImageCodecInfo, myEncoderParameters)<br />
' Image is now in MemoryStream<br />
End Sub<br />
<br />
Private Function GetEncoderInfo(ByVal MYmimeType As String) As ImageCodecInfo<br />
Dim i As Integer<br />
Dim encoders As System.Drawing.Imaging.ImageCodecInfo() = Imaging.ImageCodecInfo.GetImageEncoders()<br />
For i = 0 To (encoders.Length - 1)<br />
If (encoders(i).MimeType = MYmimeType) Then<br />
GetEncoderInfo = encoders(i)<br />
End If<br />
Next i<br />
End Function<br />
<br />
End Class<br />
<br />
Remember to close all objects when done.
Programming is like Mathematics… you take ONE step at the time!
-- modified at 12:11 Friday 24th February, 2006
|
|
|
|
|
Thanks you for your reply.
!alien!
|
|
|
|
|
your welcome!
Programming is like Mathematics… you take ONE step at the time!
|
|
|
|
|
i m working on vb.net project it is runing nice if i run it on my machine. if i copy its exe in another machine it show problem in another machine . i m using mxflexgrid component of vb and excel refrence it show error in these parts and if i run it on both machine in same time then it show problem related to sql server database.
please helpn me
for sql server it show error-the maximum simultaneous user count of 1 license for this standard edition server has been exccedd.
additonal licenses should be obtained and isstalled or u should upgrade to full version
and for mshflexgrid and excel ref it show---
for assembly name axinterop mshflexgridlib or one of its dependencies was not found
vivek
|
|
|
|
|
Well your English is quite poor so I don’t understand all you said.
For the “mshflexgrid« problem: you do not have the required assemblies on that computer.
And if I understood you right for the SQL server part: your version only supports one connection at a time (as the error message says) and so you can’t be connected more times than that.
You should really read the messages as they are quite helpful.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|