|
Hi,
I have and Issue where one of my imported fields is being formatted in the datagrid view,
The code to import the file is thus:
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then<br />
Dim fi As New FileInfo(OpenFileDialog1.FileName)<br />
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName<br />
Dim objConn As New OleDbConnection(sConnectionString)<br />
objConn.Open()<br />
Dim objCmdSelect As New OleDbCommand("SELECT SupplierID, SupplierDebrand, RangeID, RangeDebrand, ItemID, ModelNumber, Description, cost, Usual, Sell, SKU FROM " & fi.Name, objConn)<br />
Dim objAdapter1 As New OleDbDataAdapter<br />
objAdapter1.SelectCommand = objCmdSelect<br />
Dim objDataset1 As New DataSet<br />
objAdapter1.Fill(objDataset1, "test")<br />
DataGridView1.DataSource = objDataset1.Tables(0).DefaultView<br />
objConn.Close()<br />
End If
But my problem is sometime I have a model number like "0802.123" but in the grid it is showing it as "802.123" So how do I stop it from formatting it as a number as opposed to text?
Thanks in advance
|
|
|
|
|
Hi,
You can set the custom format for that column.You can try using the following code snippet.
Me.DataGridView1.Columns(1).DefaultCellStyle.Format = "0##.00"
You will have to set the column index on the above code.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Thanks for that feedback, but unfortunatly it does not work, as the data is not always numeric sometimes it is text like "CAT 10" is there a .format that will force a text value?
Regards
Simon
|
|
|
|
|
You have to use a schema.ini file to describe each column in the file you're importing. That column is being interpreted as a numeric column instead of a text string.
Read...[^] and Read[^]
|
|
|
|
|
Thank-you very much, works a treat
|
|
|
|
|
Hi,
I inserted a textbox in slide 1 and another textbox in slide 2 of the powerpoint. How do I do the coding so that the text entered in Textbox 1 (slide 1) will auto appear (transfer over) to textbox in slide 2?
Pls help. Tks!
|
|
|
|
|
|
Thanks lots!! I know nuts about coding, luckily my friend intro' me this website! Tks! =)
|
|
|
|
|
SOrry.. I have another qns. The coding works for Powerpoint 2007. BUt when I saved the file and open using Powerpoint 2003, it doesn't works.. Why is it so? Any way to resolve the prob?? Tks lots
|
|
|
|
|
i am using powerpoint 2003 . and it working !!!!!
i dont have any other option to test on ppt 2007...
Sorry !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Hi,
Can you give me the detailed steps in how to enter the above codes using Powerpoint 2003? Becoz when using powerpoint 2007, there is this readily available coding for the textbox where I entered juz by a click.
Tks lots!! sorry for the trouble.
|
|
|
|
|
--
Just open the Visual Basic ToolBar !!!, select ToolBox then
Select a Text box.....
Drag it where u want to put !!!!
Double Click It.... VB Editor will open Automatically !!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Okay. I got it. Tks lots for ur help!
|
|
|
|
|
Dude, don't scream. Its not forum for doing homework. If you stuck somewhere doing code or getting some error which you cudnt be able to resolve by Googling it, then post it here. Then we may try to resolve or give you a right direction to proceed.
Oh , ya, don't put everything in subject line and don't post same thing twice.
-Peace
"Rome did not create a great empire by having meetings, they did it by killing all those who opposed them"
|
|
|
|
|
pls tell the code to use the text box to browse using listbox
my listbox inside was my database.
now i will use textbox as a searching but i dont know what code inside the text box to browse the database inside the listbox
sheldon
|
|
|
|
|
can u please inform it clearly that what u want to do ????
I am realy confused !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
i program in visual basic now i use textbox to as a searching..in the list box! the listbox inside the list is my database! my problem is i dont know what code inside the textbox to work it. for example when i type in the textbox for example i type "computer" in the textbox now the link in the listbox turn to "computer"pls help me
|
|
|
|
|
|
Instead of posting a question that makes no sense three times, try posting a question that makes sense, once.
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 )
|
|
|
|
|
how to use scroll bar in pictur box
Piyush Vardhan Singh
|
|
|
|
|
You'd have to write the code yourself to make the scrollbar have the right extent, and to move the image. IMO you're better off just drawing the image in your paint event, it makes scrolling easier to control.
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 )
|
|
|
|
|
|
my dear i had done this but its not working
Piyush Vardhan Singh
|
|
|
|
|
but its working fine for me !!!!
Happy Programming
-----
Abhijit
|
|
|
|
|
Did you put the PictureBox INSIDE the Panel control??
|
|
|
|