|
Is DataGridView available for WebForms?
|
|
|
|
|
If you're making a WebForms app, no. The WebForm grid control is called the GridView control.
|
|
|
|
|
Thanks Dave...
I created this asp code, with ReadOnly=False on the QtyLoaded field and it still will not let me edit this field. Is there something I am missing here?
-----------------------
<asp:gridview id="GridView1" autogeneratecolumns="False" runat="server" &="">
<columns>
<asp:boundfield datafield="QtyRequired" headertext="QtyRequired" readonly="True">
<asp:boundfield datafield="QtyUsed" headertext="Qty Used" ><="" asp:boundfield="">
<asp:boundfield datafield="QtyRemaining" headertext="Qty Remaining" ><="" asp:boundfield="">
<asp:boundfield datafield="QtyLoaded" headertext="Qty Loaded" readonly="False">
<asp:boundfield datafield="PartNumberDesc" headertext="Description" ><="" asp:boundfield="">
<asp:boundfield datafield="PartNumber" headertext="Part Number"> </asp:BoundField>
-----------
Chuck
|
|
|
|
|
That confirms it. You're in the wrong forum. Ask this in the ASP.NET forum. Your question has nothing to do with VB.NET, but rather the functionality of an ASP.NET control.
|
|
|
|
|
Sorry, since I am writing the application in VB.net I thought this was the correct place.
|
|
|
|
|
I am trying to find the DataGridView control and could not find it in the .Net tools is it part of VS.Net 2005?
Chuck
|
|
|
|
|
I'm using vb6 to invoke a function in a dll with the following argurments (int argc, _TCHAR* argv[])
in vb6:
this is how i call the function in the dll..
String command = "TEST 123 456"
module(3, command)
As you can see, command is of String type.. the parameter needed is _TCHAR*
_TCHAR* is in unicode. How do I convert my String to _TCHAR*??
|
|
|
|
|
All strings in V6 are already stored Unicode encoded. They are, in the C++ world, of type BSTR.
In VB6, or any VB for that matter, you cannot pass in a point to a TCHAR array, since VB has no idea what a pointer it, nor a TCHAR. IIRC, I think you had to declare that parameter as ByRef String in your VB6 Declare statement.
|
|
|
|
|
Could you change your DLL function signature? If you can't I think it will be very difficult...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I am new to .net
can some one help me in writing a vb script to add the values in rows in an excel sheet.
say i have 5 rows with positive values.i want the result of addition of these 5 rows in the sixth row.
Thanks in advance
|
|
|
|
|
Just to be sure here,
IN VB.Net you want to get a figure from a spreadsheet?
Or...
Are you doing this with VBA within Excel?
It is useful to know, either way the answer is fairly easy, but I would need to know which so as not to waste your time and mine.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
i want to get a figure from a spreadsheet
|
|
|
|
|
I know, but are you using VB.Net OUTSIDE of a sheet and just want to pick up the figure, Or are you using VBA Within the Spreadsheet?
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
i want to run a script outside the sheet using which the contents of the sheet get updated
|
|
|
|
|
Gotcha!
OK, This gets data from a closed book and puts it into datagrid view
Imports System.Data<br />
Imports System.Data.OleDb<br />
Imports ADODB<br />
Imports System.IO<br />
<br />
<br />
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'I made this to collect all data from a sheet, you can modify as per need<br />
'by declaring a range like [Sheet1$A1:B20"]<br />
Dim sqlData As String = "Select Data * From [Sheet1$]"<br />
<br />
'To put data in a table with fieldnames then HDR should Yes and if not then No.<br />
Dim xlCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source=c:\Source.xls;" & _<br />
"Extended Properties=""Excel 8.0;HDR=YES"""<br />
<br />
Dim conn As New OleDbConnection(xlCon)<br />
Dim da As New OleDbDataAdapter(sqlData, conn)<br />
Dim dsXLData As New DataSet<br />
<br />
da.Fill(dsXLData, "Source")<br />
Me.DataGridView1.DataSource = dsXLData.Tables("Source")<br />
<br />
dsXLData.Dispose()<br />
da.Dispose()<br />
conn.Dispose()<br />
<br />
End Sub<br />
End Class<br />
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
this doesn't seem to be a .vbs syntax...
|
|
|
|
|
My Mistake, Try this...
<br />
Imports System.Data<br />
Imports System.Data.OleDb<br />
Imports System.IO<br />
<br />
Public Class Form1<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
'I made this to collect all data from a sheet, you can modify as per need<br />
'by declaring a range like [Sheet1$A1:B20"]<br />
Dim sqlData As String = "SELECT * FROM [Sheet1$]"<br />
<br />
'To put data in a table with fieldnames then HDR should Yes and if not then No.<br />
Dim xlCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _<br />
& "Data Source= PATH\SHEETNAME.XLS
" _<br />
& "Extended Properties=""Excel 8.0;HDR=NO"""<br />
<br />
Dim conn As New OleDbConnection(xlCon)<br />
Dim da As New OleDbDataAdapter(sqlData, conn)<br />
Dim dsXLData As New DataSet<br />
da.Fill(dsXLData, "Source")<br />
Me.DataGridView1.DataSource = dsXLData.Tables("Source")<br />
<br />
dsXLData.Dispose()<br />
da.Dispose()<br />
conn.Dispose()<br />
<br />
End Sub<br />
End Class<br />
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
|
No Worries, you can alter the range as necessary and it reports into a datagrid view, but obviously you can report it to other things too.
Sorry about the first code, don't know what happened there. Maybe my brain was running a little slow!
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
how to get VB form data in to a text file in a http server
here is my code but its not working
Dim FStream1 As IO.FileStream
Dim oIE As Object
oIE = CreateObject("internetexplorer.application")
oIE.Navigate("http://116.75.111.202/") = New IO.FileStream("c:\Documents\details", IO.FileMode.Append, IO.FileAccess.Write)
Dim SWriter1 As IO.StreamWriter = New IO.StreamWriter(FStream1)
SWriter1.Write(Text & vbNewLine)
SWriter1.Write(Label1.Text & vbTab)
SWriter1.Write(TextBox1.Text & vbNewLine)
SWriter1.Write(Label2.Text & vbTab)
SWriter1.Write(TextBox2.Text & vbNewLine)
SWriter1.Write(Label3.Text & vbTab)
SWriter1.Write(TextBox3.Text & vbNewLine)
SWriter1.Write(Label4.Text & vbTab)
SWriter1.Write(TextBox4.Text & vbNewLine)
SWriter1.Close()
FStream1.Close()
could anyone help me out with a correct code
|
|
|
|
|
Based on your subject line, I think you need to read the article linked to in my sig. It will solve your problems.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
Dear me. Please tell me that's just a proof of concept. There are so many things wrong with it. You assign a value to a method invocation. You use what appears to be an uninitialised variable. You take input from the user and send it with no verification, leaving you open to injection attacks. And your methodology is pretty much completely wrong. You've even posted a real IP address (which appears to need credentials to be accessed; I hope you provide them)
Your basic idea is to create a text file from your atrociously named controls, and upload it to a server somewhere in the Great Aether. So drop that code snippet and look into the WebClient class
What you need to do is to write a file to a byte array (no need to save it, the UploadData method accepts a byte array and saving just creates a new bottleneck) and call the UploadData method. So create a MemoryStream and StreamWriter. The StreamWriter should be constructed using the MemoryStream. Now, write the data to the StreamWriter in the normal way.
Next, create the WebClient instance, and declare a byte array. The byte array should be equal to the result from the invocation of the MemoryStream's ToArray method. You now have the 'file' as an array of bytes. Then, simply invoke the UploadData of the WebClient instance, passing the web address and the byte array you declared earlier. This will block execution until the upload finishes; if you fancy a challenge, dig into the documentation - there's a method which performs the same operation asynchronously and raises an event when it's done. The return value of the UploadData method is simply the response - it's useful for debugging to see where something went wrong
If, as I suspect, your HTTP server needs credentials, then set the Credentials property of the WebClient instance you declared accordingly
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
harieshkumar.n wrote: oIE.Navigate("http://116.75.111.202/") = New IO.FileStream("c:\Documents\details", IO.FileMode.Append, IO.FileAccess.Write)
What on earth is this??
Considering the FileStream class will not work with the HTTP protocol, you're concept won't work at all. Also, your web directory is probably going to be read only to every client, if this code is running on the client side, it wont be able to write to a file on the web server. Unless you do something very stupid and relax that security restriction.
Is this code in an ASP page?? Is it in some component running on the server?? What kind of app is it??
Remember, the quality of the answer you get is directly dictated by the quality of the question.
And don't use "urgent" anywhere in your post. It only makes people want to ignore you and you're not going to get an answer any faster.
|
|
|
|
|
Dear All,
I have some problem in loading an image in crystal report. I am using VS 2005 with CR 9.
I have a table adapter in which i used an unbound column "Image" of type System.Byte.
And I used the following code to set image.
....
Dim s As String = dt.Rows(0).Item("ImagePath").ToString
Dim fs As FileStream = New FileStream(s, FileMode.Open, FileAccess.Read)
Dim image(fs.Length) As Byte
fs.Read(image, 0, Convert.ToInt32(fs.Length))
dt.Rows(0).Item("Image") = image ................................(1)
fs.Close()
....
But it throws an exception at (1) [Unable to cast type of System.IConvertible to type System.Byte]
I used to debug the code, and when i reached at (1), i found the datatype of dt.Rows(0).item("Image") = System.DBNull
Although it is set to type System.Byte at design time in Table Adapter.
Please help me out
Regards,
Ovais
|
|
|
|
|
I haven't used a Table Adapter like you are talking about, but one thought that came to me when reading this is that a System.Byte is not the same data type as your image variable. You need a Byte array. This code: Dim image(fs.Length) As Byte declares a Byte array, not a Byte.
Hope this helps.
|
|
|
|