|
Try
Control + Break on the keyboard
"Crtl" + Break
hope this helps
Anoop
|
|
|
|
|
I have a large number of records in excel i want to load the records
in oracle table using vb.net.I dont know how to do it.If anybody can pls help me.I dont want to do it manually.
|
|
|
|
|
These are two seperate operations. The first is reading an Excel sheet. The second is writing data to an Oracle database.
See this[^] for a small discussion.
|
|
|
|
|
How do I set the width for a column in a datagrid made from a dataview?
|
|
|
|
|
Which grid control are you using? DataGridView (VS2005 and above) or the DataGrid (VS2002 and 2003)??
|
|
|
|
|
Why do I get the error can't find column 1.
dtStudList = generalQuery(int)
dt.Columns.Add(New DataColumn("Student Name", GetType(String)))
'dt.Columns.Add(New DataColumn("Parent Name", GetType(String)))
'dt.Columns.Add(New DataColumn("Phone", GetType(String)))
'dt.Columns.Add(New DataColumn("Cell", GetType(String)))
'dt.Columns.Add(New DataColumn("Instrument", GetType(String)))
For Each row As DataRow In dtStudList.Rows
dr = dt.NewRow()
dr(0) = row("stud_name")
dr(1) = row("stud_par_name")
dr(2) = row("stud_id")
dr(3) = row("stud_phone")
dr(4) = row("stud_cell")
' get student instruments
intStudList = Convert.ToInt32(row("stud_id"))
tableName = "tbl_lessons"
dtStudInst = generalQuery()
' create counter
Dim intCount As Integer = 1
For Each row2 As DataRow In dtStudInst.Rows
If intCount = 1 Then
strInst = Convert.ToString(row2("less_instrument"))
Else
strInst += ", " & Convert.ToString(row2("less_instrument"))
End If
Next
'dr(5) = strInst
dt.Rows.Add(dr)
intCount += 1
Next
Dim dgView As New DataView(dt)
dgrStudList.DataSource = dgView
|
|
|
|
|
AAGTHosting wrote: Why do I get the error can't find column 1.
On which line does this error show up??
You do know that you commented out a bunch of Column.Add() statements near the top of your code snippet, right? Those columns aren't getting created.
|
|
|
|
|
I know. I just need to know what I am doing wrong with the dataGrid. I commented those lnes out to see if any of the columns would be able to be found.
|
|
|
|
|
OK. Again, on what line does the error occur??
|
|
|
|
|
Hello
I have posted this few days ago, I want to random records form MS access database and according to Christian Graus i have tried this it's working so so but i am still not happy i am still trying it but i dont know what to do now
this was before Christian's rep.
First code
Try<br />
<br />
Me.conTest.ConnectionString = _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= MyTest.mdb"<br />
Catch eConnection As System.Exception<br />
MessageBox.Show(eConnection.Message)<br />
End Try<br />
<br />
'if array size is smaller then increase as per entry<br />
ArraySize = Count<br />
Dim IntegerArray(ArraySize) As Integer<br />
'sort integers<br />
Call SortArray(ArraySize, IntegerArray)<br />
Try<br />
odaTest.Fill(dsTest)<br />
'lblNo.Text = Me.BindingContext(dsTest.MyTest).Position<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
Call dsContacts_PositionChanged()<br />
End If<br />
<br />
this is for array <br />
<br />
Private Sub SortArray(ByVal N As Integer, ByVal SortedArray() As Integer)<br />
'increase the array size according to number of entry <br />
For I As Integer = 0 To N<br />
SortedArray(I) = I<br />
Next I<br />
End Sub
============
and this is after rep.
it's workind ok but i am sure i am doing something wrong but what ?
this is the new code
Try<br />
<br />
Me.conTest.ConnectionString = _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= MyTest.mdb"<br />
Catch eConnection As System.Exception<br />
MessageBox.Show(eConnection.Message)<br />
End Try<br />
Me.conTest.Open()<br />
Dim MyData As New OleDb.OleDbCommand("SELECT *FROM MyTest ORDER BY ID ", conTest)<br />
Dim DR As Data.OleDb.OleDbDataReader = MyData.ExecuteReader<br />
Do While DR.Read = True<br />
ArraySize += 1<br />
Loop<br />
DR.Close()<br />
<br />
'if array size is smaller then increase as per entry<br />
Dim IntegerArray(ArraySize) As Integer<br />
'sort integers<br />
Call SortArray(ArraySize, IntegerArray)<br />
ReDim Asked(ArraySize)<br />
Call dsContacts_PositionChanged()<br />
<br />
Private Sub NavNext()<br />
If AskedQ >= ArraySize Then<br />
MessageBox.Show("Finish want to play again..?", "Finish", MessageBoxButtons.OK)<br />
For I As Integer = 0 To ArraySize<br />
Asked(I) = False<br />
AskedQ = 0<br />
Next<br />
Exit Sub<br />
Else<br />
Try<br />
Do<br />
odaTest.Fill(dsTest)<br />
R = CInt(Rnd() * ArraySize)<br />
'[Go to the next entry]<br />
Me.BindingContext(dsTest, "MyTest").Position = R<br />
Loop Until Asked(R) = False<br />
AskedQ += 1<br />
Asked(R) = True<br />
Catch eLoad As System.Exception<br />
MessageBox.Show(eLoad.Message)<br />
End Try<br />
'[See custom procedures]<br />
Me.dsContacts_PositionChanged()<br />
End If<br />
End Sub
waiting for your kind rep.
thanks you
|
|
|
|
|
bapu2889 wrote: Dim MyData As New OleDb.OleDbCommand("SELECT *FROM MyTest ORDER BY ID ", conTest)
Dim DR As Data.OleDb.OleDbDataReader = MyData.ExecuteReader
Do While DR.Read = True
ArraySize += 1
Loop
This is messy. If you need a count of elements, do select count(*) from mytest to get it in one go. This seems to me to be assuming that the Id's have no gaps in them, can you guarentee that ?
I'm not following how the rest works, but I *think* you're doing what I'd suggest in this instance ( keep a list of all the question Ids, then remove from that list at random to make sure no question gets asked twice )
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 )
|
|
|
|
|
Hello sir
first of all thank you very much for your super fast rep.
i am trying to get it to it but still i am in dark
you mean
Count = Me.BindingContext(dsTest, "MyTest").Count
some thing like this ?
and i can guarentee you that there is no gape in ID's
sir i am doing this since last one week so i think i am thinking too much and i am not seeing the thing which is in front of me
but it's nice fun
one day i will get there
waiting for your kind rep.
thanks again
|
|
|
|
|
OK, if your IDs are from 0-200, for example, then you need to build a list from 0-200
Then you get a random number between 0 and 200, pull out the number at that location, and get the record with that Id and show it. The next time, the number is between 0 and 199, because there's one less item in the list. You do this, because it means you're pulling at random, but you can never end up with the same record twice.
The other way to do this is to do a random shuffle on your list, you would do that by doing a sort method that returns a random result. Then you can work on the list in sequence.
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 )
|
|
|
|
|
Hello sir
good morning
this is want i have done last night but still it's getting same questions again and again
but i will try your next command today but i dont know that i am going in to right direction
Private Sub Display()<br />
' Open the database.<br />
Dim conn As OleDbConnection = GetDbConnection()<br />
<br />
' See how many records there are.<br />
Dim query As String = "SELECT COUNT(*) FROM MyTest"<br />
Dim cmd As New OleDbCommand(query, conn)<br />
Dim num_records As Integer = cmd.ExecuteScalar()<br />
If txtNum.Text > num_records Then<br />
MsgBox("Hello there is only " & num_records & " records in database" & vbCrLf & _<br />
"So please enter " & num_records & " or less then " & num_records, MsgBoxStyle.Exclamation)<br />
Exit Sub<br />
End If<br />
' Make an array to hold the selected indexes.<br />
Dim num_random As Integer = num_records<br />
Dim Asked(num_random) As Boolean<br />
Dim indexes(num_random - 1) As Integer<br />
Dim sorted_indexes As New SortedList(num_random - 1)<br />
' Generate the indexes.<br />
Dim rand As New Random<br />
Dim I As Integer<br />
For I = 0 To num_random - 1<br />
' Generate the i-th index.<br />
Dim new_value As Integer = rand.Next(0, num_records - I)<br />
<br />
' For each previously generated index <=<br />
' than this one, increment this one.<br />
For j As Integer = 0 To I - 1<br />
If sorted_indexes.GetByIndex(j) <= new_value Then<br />
new_value += 1<br />
End If<br />
Next j<br />
<br />
' Save tjhe new value.<br />
indexes(I) = new_value<br />
sorted_indexes.Add(new_value, new_value)<br />
Next I<br />
query = "SELECT * FROM MyTest " & "WHERE Index=?"<br />
cmd = New OleDbCommand(query, conn)<br />
Dim i2 As Integer<br />
' Fetch record i.<br />
Dim index As Integer = indexes(i2)<br />
cmd.Parameters.Clear()<br />
cmd.Parameters.Add(New OleDbParameter("Index", index))<br />
Dim reader As OleDbDataReader = cmd.ExecuteReader(CommandBehavior.SingleRow)<br />
reader.Read()<br />
lblA.Text = reader.Item(i2).ToString<br />
' Close the connection.<br />
conn.Close()<br />
conn.Dispose()<br />
End Sub
thank you sir for your time
have a nice day
|
|
|
|
|
We run RunAsp Professional with XP to run a prgram that maps a network drive. It will also hide the mapped drive so noone can go to my computer and get to the drive.
My question, runAsp Professional does not work with Vista. Does anyone have a fix for this.
2nd question. We don't need runAsp if we can hide the mapped drive. Does anyone know how to do that in like a bat file.
thank you
|
|
|
|
|
<blockquote class="FQ"><div class="FQA">Cory Kimble wrote:</div>My question, runAsp Professional does not work with Vista. Does anyone have a fix for this.</blockquote>
How about asking the people who wrote runASP Pro?
What do you mena by "hiding" a share?? All you have to do to make a share not appear in the browser is end the name of the share with a $. But, it's still possible for users to get at it if they know what the name is.
|
|
|
|
|
I am working with someone else project. The have a bat file that does a net use to map a drive to the server so it can run a dBase program.
net use y: \\server\eqdb$ /user:****\**** 3qvf0#WL
This creates the drive but it can be seen in my computer.
When we use runAs Professional (not compatible with vista) it hides or does not display the drive.
Is there a way to do that with just the microsoft runas command line feature? Any ideas. We just want a way so someone can't go in and delete the drive on the server.
Thank you.
|
|
|
|
|
Cory Kimble wrote: Is there a way to do that with just the microsoft runas command line feature?
No. RunAs just executes a command line as another user. It has nothing to do with hiding mapped drives. It may be a side affect of load/not loading another users profile. That's about all I can think of.
According to the makers of RunAs Pro, there is currently no version that works on Vista.
Cory Kimble wrote: We just want a way so someone can't go in and delete the drive on the server.
Then use appropriate Share and NTFS permissions on the server instead of relying on a "hack" that may be not supported in future versions, or patches, of Windows.
There is no command that just "hides" drive letters.
|
|
|
|
|
I found a program that can hide drives. TWEAKUI for XP and TWEAKVI for Vista
|
|
|
|
|
Ohh!! I though you were talking about hiding the share the drive mapped to.
Well, there is nothing special about TWEAKUI. All it does is make changes to the registry. You can "hide" drive letters just by modifying a regsitry value. Here...[^]
|
|
|
|
|
1. How do I move a form to the top (above other forms) but not keep it there (not .topmost)
2. Is it possible to trap the X (close form) event on the top bar such that the form doesn't actually close but rather does something else?
Thanks
|
|
|
|
|
on 1. yourForm.BringToFront
on 2. There is the Closing-event for your form (formClosing in vb2005). In that event use e.cancel=true to prevent the form from being closed.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
|
I'm writing an app that uses report viewer to create a detail report.....sorta like a invoice, where it lists the company name and all that they bought and an image of the item they bought. So I created my report and the sub-report for the details section. However when I go to run it I get the company name but the details section grabs all parts for all companies then the break on the next company....then repeats.
Isn't there something else that is better than this? And I cannot believe that there is no one around me that has never used this...how are all these apps getting written that are using some report?
thanks for letting me vent. Any suggestion would be appreciated. And by the way I am passing the key as a parameter from the main report to the sub.
Tom
Tom Wright
tawright915@gmail.com
|
|
|
|
|