|
I need to extract the value of the folowing column and put it in the startTime variable. This particular query only return one row. I am not sure how to do this and am getting the blue line under lpDataSet.tbl_teach_sched.ts_dayColumn.
startTime = lpDataSet.tbl_teach_sched.ts_dayColumn
|
|
|
|
|
Try something like this:
With lpDataSet.tbl_teach_sched("TableName") <br />
Dim dr As DataRow = .Rows(0)<br />
startTime = dr("ColumnName") <br />
End With
Where "TableName" and "ColumnName" are from your DataSet and DataRow properties.
Hope this points you in the right direction.
I don't speak Idiot - please talk slowly and clearly
|
|
|
|
|
I need code example how to use tcpclint in vb.net ,especially how to receive data?
|
|
|
|
|
How i can make my form design effectual, it means if i change my screen resolution the form change and the controls move accordingly?
many thanks
|
|
|
|
|
By using the dock and anchor properties ( mostly Anchor ) to make the form elements resize as you'd like when the form resizes.
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 )
|
|
|
|
|
Dock and anchor of the controls, LayoutPanel and TableLayout for arranging the controls in a nicely scaled or controlled formation.
|
|
|
|
|
Hello.
I'm making an Windows Installer, and am running into some problems with files not being found (and in turn, unsuccessful/incomplete installs). I think this may be due to my installer File System.
My question: What is the "targetDir" option used for in the below string, and what location exactly does "[TARGETDIR]/" point to? Can I extend this (e.g. "[TARGETDIR]/subdir1/")? If so, how?
"/targetDir="[TARGETDIR]/" /documentName="ExcelAddIn.xls" /assemblyName="ExcelAddIn.dll"
|
|
|
|
|
I am creating columns in a dataGrid. I know that I can loop through each row using a for each loop, but how do I make sure that the data from each row is in each column. Can someone tell me whether this will work.
The column ts_day stores each day of the week. So, the column will display Monday, then Tuesday, etc.
' This is the line of code that puts each row from the database in the column.<br />
lpDataSet.Tables(0).Columns.Add(New DataColum("lpDataSet.tbl_teach_sched.ts_dayColumn", GetType(String)))
<br />
' populate the data tables<br />
dtTeachSched = lpDataSet.Tables("tbl_teach_sched")<br />
<br />
' create the data columns<br />
lpDataSet.Tables(0).Columns.Add(New DataColumn("Time", GetType(String))<br />
<br />
For Each row In dtTeachSched.Rows<br />
' This is the line of code that puts each row from the database in the column.<br />
lpDataSet.Tables(0).Columns.Add(New DataColum("lpDataSet.tbl_teach_sched.ts_dayColumn", 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
|
|
|
|
|
Sorry, but your question is very confusing to me. What are you trying to do? If you want a DataGridView to display from a DataTable, all you have to do is this:
dgvMyDataGridView.DataSource = dtMyDataTable
If you want the DataGridView to display additional columns after that, you could first add them to the DataTable and loop through the DataTable to fill it...is that what you were asking about??
Hope this helps.
|
|
|
|
|
I am creating a datagrid view from multiple database tables. This is how the dataGrid would be laid out. This same layout would exist for each day of the week that this teacher has a schedule.
Under the Monday column the names come from the students database table. The number of weeks comes from the student payments table. This shows how many weeks the student paid for this month. The note in the notes column comes from the the student payments table if the student had paid. If there is a cancelation or some other problem with the lesson that week then the note comes from the lesson status table. The blank row is a time that the teacher is available, but the time slot is empty.
The x's are times that the teacher is not available
Time | Monday | weeks | notes
12:00|john doe| --4-- | -pd- |
12:30|mary doe| --5-- | -pd- |
1:00-|buck doe| --4-- | ns+c |
1:30-|----x---|---x---|--x---|
2:00-|--------|-------|------|
I am using a tableAdapter for each database table but am used to using joins with php.
I have multiple questions.
1) would it be better for me to just do my own query with a join so that I don't have to use all these tableAdapters?
2) Or would it better for me to create a View in the database and query the view.
3) My original question was how do I assure that each day such as Monday, Tuesday, etc that the teacher has a schedule shows up as a column. Keep in mind that I can't simply show what is in one database table as you have shown above.
This is the line of code that I am not sure how it works. Will it increment through the database table rows and for each column that should have a day of the week displayed in it dispay that day of the week.
Here is the line of code.
lpDataSet.Tables(0).Columns.Add(New DataColumn("lpDataSet.tbl_teach_sched.ts_dayColumn", GetType(String)))
This is the code that pupulates that column with a row from the database such as Monday or Tuesday.
lpDataSet.tbl_teach_sched.ts_dayColumn
Keep in mind that when you query this database table for this column it would look like this. The following example is for a teacher that works on monday, Tuesday, Wednesday and Friday.
ts_id | ts_day | teach_id
| |
1 | Monday | 100
2 | Tuesday | 100
3 | Wednesday | 100
4 | Friday | 100
|
|
|
|
|
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
|
|
|
|