|
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
|
|
|
|
|
I have written the below code but I execte the program I am getting this error.
"Retrieving the COM class factory for component
with CLSID {FF76CB60-2E68-101B-B02E-04021C009402}
failed due to the following error: 80040154."
Can anyone explain me the reason for it being or if you have anyother method to change PDF to JPEG you can suggest me.
Actual code:
Dim doc As Acrobat.CAcroPDDoc
Dim page As Acrobat.CAcroPDPage
Dim pt As Acrobat.AcroPoint
Dim rect As Acrobat.AcroRect
Dim data As IDataObject
Dim bmp As Bitmap
'**********************************
'***********************************
'Test using forum code
'***********************************
doc = New Acrobat.AcroPDDocClass()
page = Nothing
doc.Open("D:\Adil\AAA.pdf")
page = doc.AcquirePage(0)
pt = page.GetSize()
rect = New Acrobat.AcroRect
rect.Top = 0
rect.Left = 0
rect.right = pt.x
rect.Left = pt.y
page.CopyToClipboard(rect, 0, 0, 100)
data = Clipboard.GetDataObject()
bmp = data.GetData(DataFormats.Bitmap)
bmp.Save("D:\Adil\AAA1.jpeg")
adil kazmi
|
|
|
|
|
The Acrobat class copies the PDF to the clipboard as a PDF ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Possibly try this[^]
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message".
|
|
|
|
|
i have a working network connection that i can view my computers on the lan
netview returns the computers correctly but when i try using
dns.gethostentry(computername), it returns an error that "host unknown"
any help?..Thanks
phatkin
|
|
|
|
|
Don't repost the same question. You posted the same question not more than an hour and half ago.
We do this on a volunteer basis, answering questions on our own time, when we get the time. We don't get paid to do this, you're not paying for support, so you shouldn't expect paid support speed.
|
|
|
|
|
plz give us basic steps to proceed in our speech recognition project.
Sonali Thakur
|
|
|
|
|
Step 1 - Evaluatation of current market
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Speech example
hope above link helps you
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
:(Hi, I am really struggling to figure out how to add the values in a datagrid column named "Category Ratio". I don't want the "Category Ratio" column total to be less than or higher than 100(it is functioning as a percentage column) and I therefore need to check that the user has set the colun values for each row to add up to 100. Can anybody tell me how to add up the column values. The column is the second column in the datagrid. column 1 = "Category Name" column 2 = "Category Ratio". Thanks
Mr Oizo
|
|
|
|
|
Hi,
Adding the values up is not that difficult, just loop through the rows in the dataset or datatable (not the datagridview) and add up the values. Something like this:
<br />
Dim rw as DataRow<br />
Dim i as Integer 'or double or whatever<br />
For each rw in YourDataSet1.Tables("YourTableName").Rows<br />
If IsDbNull(rw.Item("Category Ratio")) = True Then<br />
i += 0<br />
Else<br />
i += rw.Item("Category Ratio")<br />
End If<br />
Next<br />
What you really need to think about though, is how you want your app to react when the rows do not add up to 100 percent: throw a simple MessageBox and let the user calculate it in his head, reset all values to 100 divided by the number of rows, adjust all values equally, adjust only all values or some, or only one according to certain logic?
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
HI..
pls help me to get the system time.. vb.net..
chamil
|
|
|
|
|
i dont know if pocket pc really applies to what you want....meaning compact framework right?
otherwise, i think with a datetimepicker and a timer control's tick method you can get the timer at every tick even to millisecond
just check the interval property of the tmer control
phatkin
|
|
|
|