|
This is tricky because you are taking a table that flows vertically and changing it to view horizontally....you will probably have to pull the "Day" table separately....then loop through the day table and add a new column to the grid for each day. then you will have to loop through the rows to populate the data in this new column. Does this help?
|
|
|
|
|
I know that this is how I have to do it. The question I have that I need answered is what line of code represents row one of the ss_day column and how do I increment this code within the loop.
I know I increment the loop by using dtTeachSched.Rows.
I need to know if this line of code will show me each ts_day row as the loop increments.
lpDataSet.tbl_teach_sched.ts_dayColumn
This is how I have my loop written now.
For Each row In dtTeachSched.Rows<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Notes", GetType(String)))<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Weeks", GetType(String)))<br />
Next
|
|
|
|
|
I'm still not sure I know what you are asking...you need to remember that we don't know your table structures and naming conventions so it's hard to understand what you mean when you say things like "what line of code represents row one of the ss_day column"... So this is what I'm thinking you are asking...
You have a table of days that a teacher has on his/her schedule. You loop through this table and for each day in it, you add a column to another table (we'll call it table 2). Now you want to know how to access the new columns in table 2 and fill them with data? Right?
Well, for each day that you add a column for, you are going to have name the column something different. I do not think you are even allowed to add two columns to a table with the same name. Then you will access the data by refering to that name. For example, you may do something like this:
Dim intCount as Integer = 0<br />
For Each row as DataRow In dtTeachSched.Rows<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Day_" & intCount, GetType(String)))<br />
Next
Then when you are ready to fill the data in later, you would access data the first row of the first new column like this:
strDataFromNewColumn = lpDataSet.Tables(0).Row(0)("Day_1")
I hope this helps point you in the right direction.
|
|
|
|
|
i am trying to use the gridview to display information but its not building.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbconnection As SqlConnection
Dim command As SqlCommand
dbconnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True")
command = New SqlCommand("Select * from tblcustomers", dbconnection)
dbconnection.Open()
'MsgBox("connection open")
GridView1.DataSource = command.EndExecuteReader() <------error on this line
GridView1.DataBind()
dbconnection.Close()
|
|
|
|
|
solarthur01 wrote: command.EndExecuteReader()
Shouldn't it be: command.ExecuteReader()
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
many thanks. I used a different method:
Dim myconnection As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True")
myconnection.Open()
Dim ad As SqlDataAdapter = New SqlDataAdapter("Select * from tblcustomers", myconnection)
Dim ds As DataSet = New DataSet
ad.Fill(ds, "tblcustomers")
GridView1.DataSource = ds
GridView1.DataBind()
myconnection.Close()
Label1.Text = ("Database connection open")
Do you know how i can use the sleep function to let it sleep before displaying the next record...so as supopsed to displaying all the records at once, it will display it in time interval of say 3000 mseconds??
|
|
|
|
|
Use the Timer class.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
do you know how i can implement it or where i can get some information about it from?
|
|
|
|
|
Google.
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 )
|
|
|
|
|
Hi every body.
Can any body help me plz
I have a task that requires to read the text on a image
My requirement is
I take a image of a vehicle number plate through a web cam or a usb camera.
Now when i get the image when i click a button i should get the numberplate number into a text box I need this functionality using c# or vb.net plz help me i am doing my B.tech final year project, I would be very much thank full if any one will help me
thanks in advance
with regards
harivinod
|
|
|
|
|
I suggest you get some advice from your professor, that's his job. If this is your final project and you have a choice to switch, I suggest you do that. This is going to be a pretty tough project to undertake. If you choose to continue, good luck. Remember, google is your friend. If you have specific questions or problem areas, ask here.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Don't expect people to do your assignment for you. ASk your teacher for help, that is what he's there for.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
You will need to look into Optical Character Recognition (OCR).
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'
|
|
|
|
|
first of all have u tried google for this question. if not that's bad. u must understand the way of searching.
ok now your answer. now its up to u how will u take this... best of luck.
Dim Doc1 As New MODI.Document <br />
Dim inputFile As String = "C:\test\multipage.tif"<br />
Doc1.Create(inputFile)<br />
Doc1.OCR()<br />
' this will ocr all pages of a multi-page tiff file <br />
Doc1.Save()<br />
' this will save the deskewed reoriented images, and the OCR text, back to the inputFile <br />
Dim strRecText As String = ""<br />
For imageCounter As Integer = 0 To (Doc1.Images.Count - 1)<br />
' work your way through each page of results <br />
strRecText &= Doc1.Images(imageCounter).Layout.Text<br />
' this puts the ocr results into a string <br />
Next<br />
File.AppendAllText("C:\test\testmodi.txt", strRecText)<br />
' write the OCR file out to disk <br />
Doc1.Close()<br />
' clean up <br />
Doc1 = Nothing
help everyone
Falling down is not defeat...defeat is when u refuse to get up...
|
|
|
|
|
How I can get the filename from the openfiledialog without the full path?
I have filename as in openfiledialog
"C:\Upload\trp.txt"
I want Only "trp.txt".
How this can be done by vb.net 2005?
THanks in advance
|
|
|
|
|
There is a better way to do it, I am sure. And perhaps someone else will also answer your question with this better solution, but here is the one that I remember using once:
<br />
Dim backslash As Char = "\"<br />
TxtFileName.Text = ""<br />
OFD.ShowDialog()<br />
TxtFileName.Text = OFD.FileName.Substring(OFD.FileName.LastIndexOf(backslash) + 1)<br />
My advice is free, and you may get what you paid for.
|
|
|
|
|
Imports System.IO
With OpenFileDialog1
.Title = "Get File Name"
.ShowDialog()
myFileName = Path.GetFileName(.FileName)
End With
|
|
|
|
|
|
What's your question? All I see is some deranged, half-assed looking run-on sentence. Where are you having problems?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Justin Perez wrote: What's your question? All I see is some deranged, half-assed looking run-on sentence. Where are you having problems?
Thanks for new sig material
"What's your question? All I see is some deranged, half-assed looking run-on sentence. Where are you having problems?" - Justin Perez
|
|
|
|
|
My pleasure
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
I have a datagridview control in which I populate data from a data table.When I click on the coloumn header of the gridview control,then the data which are displayed are sorted in the reverse order on which it was originally diaplayed.
Issue:Now I want that the data should not be sorted when ever I click on any of the coloumn headers of the data gridview i.e I want all the coloumn headers of the gridview controls should be read only irrespective of clicking on it.When I will click on the gridview column header no actions should not be there in th gridview.
Please help me out in this issue.Its very urgent.
Thanks in advance.
Pradip Kishore
|
|
|
|
|
Hi Pradip Kishore
Use DataGridView Properties
Columns->; Selected Columns, (Select Column) and use Behavior: SortMode->;(Select your options) Notsortable
Franics K Antony
|
|
|
|
|
Hi Francis,
Thanks a lot for the quick response.
I have a requirement that when even I checked on certain data items in the gridview(GV) then the color must be changed (which i did),but now the problem is that when I click on any of the coloumn headers,the colors of the items which I had checked got vanished and the data is shown in the GV as fresh data as if no items have been checked.
Please let me know how to prevent the color change when somebody clicks on any of the coloumn headers of the GV..?
Thanks in advance.
Pradip Kishore
|
|
|
|
|
I have two ListBox in vb.net. I want if a user drag any item from one listbox and drop it into other then it got add in other listbox.
please help
modified on Friday, January 25, 2008 5:44:23 AM
|
|
|
|