|
Please try this:
Dim MyCommand1 As New OleDBDataAdapter("select " & col1 & ", count(*) As [Count] from [flnme$] group by " & col1, conn1)
petersgyoung
|
|
|
|
|
I tried working the sql statement you posted and I still receive the Unhandled Exception Error. I've even tried tweaking it by taking the "group by" out of the statement. But I'm going to continue to tweek the code maybe VB 2003 doesn't like something about the statement.
Swish
|
|
|
|
|
"Group by" should work. Very likely, your statement cannot find something in your Excel, e.g. Table Name, Column Name, File Location, etc. The easiest way for me to help you is to get a copy of your Excel file. My email address is petersgyoung@hotmail.com.
petersgyoung
|
|
|
|
|
Hello all
I have developed my own grid, based on MsFlexGrid. My grid support editable feature also.
Now when i put mygrid to a standard exe, i am able to increase the row and coloums, but am not able to resize the container of the grid, so that always only one row and one col is visible, else will be under scrollbar. can you please help
|
|
|
|
|
I'm sure this is a simple question...
I have a custom scrollbar that I would like to attach to a listbox. How do I get the scroll event to scroll the listbox?
Thanks!
|
|
|
|
|
HI,
COrrect this is simple but best........
First u select list box and then go to properties u select the scrollAlways Visible can be True mode and then working for scrollbar ok......
V.sen...
|
|
|
|
|
hi
in my project i need to draw some drawings in a picturebox and then save it into a metafile(vector).
please help me how ?
i don't know GdipRecordMetafile api does it or not ?!
also i want to know is it possible to save a DIB section data into a wmf file ? (a simple monochrome -1 bit- bitmap)
thanks
|
|
|
|
|
is it possible to save vector image from vb at all ?
|
|
|
|
|
Hi,
I need to add a custom menu item to the file menu's export to option in infopath 2003 form. can any one help?
Regards,
Lavanya
|
|
|
|
|
Hello,
I want to create an array of pointers to buttons.
Then by accessing the elements of the array I want to change the captions of the buttons.
I miss the pointers in C++. How can I implement pointers in Visual Basic.
Thank you!
modified 8-Mar-17 3:48am.
|
|
|
|
|
Daniel Kanev wrote: I miss the pointers in C++. How can I implement pointers in Visual Basic
You don't - You have references instead. They act like pointers without all the tedious stuff. Your array will be an array of references to buttons. They button will be created on the heap automatically.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
How do I block sql injection from bypassing, or even corrupting, the database at the logon screen?
Evan Saunders
|
|
|
|
|
Do not use dynamic SQL to build up your queries. Read up on 'parameterized queries' instead.
|
|
|
|
|
Use a stored procedure for your login function, and pass the username and (presumably) hashed password to it as parameters. SQL injection is only really a problem if you build an SQL query on the application side from inputted strings. Also type your SQL fields as strictly as you can.
|
|
|
|
|
|
hi all
i m working on a project that's simply open a txt, csv, xls file,
make some modifications and save the file in the same format
i m facing two problems
1. how to save the file in xls format ( i have opened it but unable to save )
2. how to decrease the time taken by the application to process my query ( my query is to search some thing in the text.)
because the text file contains more than 1,00,00,000 lines, when i search the string in that file the execution of program decrease drastically.
i m using rich text box
the code i used to search is
For j As Integer = 0 To str1.Length - 1
K = 0
For i As Integer = 0 To len
If K <= len Then
If (rtb1.Find(str1(j), K, RichTextBoxFinds.MatchCase)) <> -1 Then
rtb1.Select(rtb1.Find(str1(j), K, RichTextBoxFinds.MatchCase), str1(j).Length)
rtb1.SelectionBackColor = Color.Yellow
'rtb1.SelectedText = "zz "
End If
End If
'lbl2.Text = K & " " & j
K = K + str1(j).Length
pg1.Value += 1
Application.DoEvents()
Next
Next
does some one has any idea
thnx in advance
help everyone
|
|
|
|
|
eyes2007 wrote: 1. how to save the file in xls format ( i have opened it but unable to save )
What code are you using to load this file?
eyes2007 wrote: . how to decrease the time taken by the application to process my query ( my query is to search some thing in the text.)
because the text file contains more than 1,00,00,000 lines, when i search the string in that file the execution of program decrease drastically.
Uhhh...How many lines again?? I can't tell if that's a billion, million, or 10 million...
What did you expect?? That's an enormous amount of text to search through. You're not going to get instant results. Why are you using a RichTextBox to search through a text file?
|
|
|
|
|
i use openfiledialog to load the file.
rtb1.LoadFile(objFileOpen.FileName, RichTextBoxStreamType.PlainText)
can u suggest me one better tool to use then rich text box
(it is notepad like application i m working on)
thnx
help everyone
|
|
|
|
|
eyes2007 wrote: i use openfiledialog to load the file.
rtb1.LoadFile(objFileOpen.FileName, RichTextBoxStreamType.PlainText)
You're using this code to load an Excel (*.xls) file into an RTB??
Why are you using a RichTextBox at all?? If you're coding is just doing search and replace of text in a file, why are you using a RTB??
I don't know what the point of this code is. First, you say you're doing search and replace in several types of files containing millions of lines of text. Then you say you're writing a Notepad replacement. Which is it?
|
|
|
|
|
hi dave
i think u r not understand my problem, i will explain in detail
1. my application's initial requirement is to open files having extention of *.txt, *.xls, *.csv
2. i need an editor to edit data of the files ( I already made it using rich text box, that's y i use RTB ( will u suggest a better option to use to edit text of data ))
3. the code to open excel file is
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
For j As Integer = 0 To ds.Tables(0).Columns.Count - 1
rtb1.Text = rtb1.Text & " " & ds.Tables(0).Rows(i).Item(j).ToString()
Next
rtb1.Text = rtb1.Text & Chr(13)
Next
what else can i tell u just ask me
thnx
help everyone
|
|
|
|
|
eyes2007 wrote: 3. the code to open excel file is
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1 For j As Integer = 0 To ds.Tables(0).Columns.Count - 1 rtb1.Text = rtb1.Text & " " & ds.Tables(0).Rows(i).Item(j).ToString() Next rtb1.Text = rtb1.Text & Chr(13) Next
Good luck saving that back to an .xls file...
You can use either a RTB or a TextBox with the character limit set to -1. You can't improve the performance of the search and replace on huge files. You simply have to pare down the size of the file.
|
|
|
|
|
what's that means (Good luck saving that back to an .xls file...)
can u tell
help everyone
|
|
|
|
|
It means you created a string of text out of the data in each cell. Sure, you can make changes to the text, but how are you going to save those changes back to an .XLS file??
|
|
|
|
|
Hi
I am trying to Devloping Mobile Application in .Net Technology
I want to detect incoming call in Mobile using .net Technology
How can I do it ?
Do you have any idea?
Please help me
Regards
Nimesh
|
|
|
|
|
hi nimesh,
you choose wrong form. but solution is following
declare following at form level
Dim callState As New <br />
<br />
Microsoft.WindowsMobile.Status.SystemState(Microsoft.WindowsMobile.Status.SystemProperty.Pho<br />
<br />
neCallCalling)
add following code at form load event
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles <br />
<br />
MyBase.Load<br />
<br />
AddHandler callState.Changed, AddressOf callState_changed<br />
<br />
End Sub
and add following procedure
Private Sub callState_changed(ByVal sender As System.Object, ByVal args As <br />
<br />
Microsoft.WindowsMobile.Status.ChangeEventArgs)<br />
<br />
If (Microsoft.WindowsMobile.Status.SystemState.PhoneIncomingCall = True) Then<br />
'(your code) <br />
End If<br />
End Sub
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|