|
http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032319980&CountryCode=US
Try this video.
|
|
|
|
|
Can any one plz help me to get the code for my problem.
problem:
I have to generate tables at runtime from Ms Access data base. Number of tables to generate depends on the sql query we pass in the program and the depends on the data in the tables.
So I want the code for diplaying a table on control panel and fill the data to it from the Access files based on the query.
Plz reply me if you got any ideas or codes for this
thank you
dil
|
|
|
|
|
I have to generate tables at runtime from Ms Access data base. Number of tables to generate depends on the sql query we pass in the program and the depends on the data in the tables.
>> User the "create table ... " query statement to create the table with number of columns and their types.
So I want the code for diplaying a table on control panel and fill the data to it from the Access files based on the query.
>>Do you have any file, which holds datas for newly creating tables?
Be simple and Be sample.
|
|
|
|
|
Thanks for favourable answer "ramskr".
I am trying to generate the grid view table on the control panel through for loop by using the sql query.
I got the code to get the data from the Access data base.
So the thing I need is, code to generate table at run time
Cheers.
dil
|
|
|
|
|
how to get the date format in vb?
Jayesh Talsaniya
|
|
|
|
|
Do you need to extract, month, day, year from date?
use -> Date.month , Date.day, Date.year. Also you can convert date to shortdate, shorttime, longdate and longtime as string.
Be simple and Be sample.
|
|
|
|
|
no i dont mean that.
i want to check the format fo the date that is in the textbox contol.
wether it is dd/mm/yyyy or /mm/dd/yyyy or other....
Jayesh Talsaniya
|
|
|
|
|
In VB.net there is no direct control to check format. Try with masked text box. You have to write own code on keypress event - first 2 digit should be below 12 (if it is month) and so on.
Be simple and Be sample.
|
|
|
|
|
oh is it so?
k thanx for replying.
now i wil code for that.
regards
Jayesh Talsaniya
|
|
|
|
|
Unless you limit the input of the user, there's no way to tell what format the date is in, reliably. Think about it. Which number is the month and which is the day in "6/6/07"? With restricting the user to a known format, it's impossible to tell. You could get a good clue if you looked at the culture information though. Chances are, the entered date will follow the standard format for a country. Mostly... Check out the CultureInfo class. You can get the current culture your code is running under and get the DateTimeFormat from there. This would be the culture of the O/S is setup for, NOT necessarily the one the user typed into a TextBox.
|
|
|
|
|
Hi,
I have a gridview of 5 columns.In that 3 column has radiobutton grouped in each row.
<asp:templatefield sortexpression="Item" headertext="Item">
<headerstyle width="15%" horizontalalign="Center" forecolor="White">
<itemstyle wrap="false" horizontalalign="Left">
<edititemtemplate>
<asp:textbox id="txtEditItem" visible="false" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Item")%>">
<itemtemplate>
<asp:label id="lblItem" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Item")%>">
<asp:templatefield sortexpression="Yes" headertext="Yes">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbYes" runat="server" groupname="item1" checked="true" enabled="true">
<asp:templatefield sortexpression="No" headertext="No">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbNo" causesvalidation="true" runat="server" groupname="item1" enabled="true">
<asp:templatefield sortexpression="NA" headertext="N/A">
<headerstyle width="7%" horizontalalign="Center" forecolor="White">
<itemstyle horizontalalign="Center">
<itemtemplate>
<asp:radiobutton id="rbNA" runat="server" groupname="item1" enabled="true">
<asp:templatefield sortexpression="Comments" headertext="Comments">
<headerstyle width="44%" horizontalalign="Center" forecolor="White">
<itemstyle wrap="false" horizontalalign="left">
<edititemtemplate>
<asp:textbox id="txtEditComments" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Comments")%>">
<itemtemplate>
<asp:label id="lblComments" runat="server" text="<%#Databinder.Eval(Container.DataItem,"Comments")%>">
in this Button "rbYes" is checked by default. if i cliked "rbNo" or "rbNA" the other 2 columns must be editable.
Can anyone help me out in this..
expecting ur response..
Kanimozhi.S
|
|
|
|
|
Does this help any?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1727092&SiteID=1
|
|
|
|
|
HI ALL
CAN ANY ONE HELP ME WITH THIS....
I HAVE A DATAGRIDVIEW IN MY WINDOWS APPLICATION AND I POPULATE IT WITH DATA PROGRAMATICALLY.
BUT NOW I WANT TO PERFORM THE FOLLOWING OPERATIONS DIRECTLY ON MY DATAGRIDVIEW...
1. ADDING A NEW ROW TO DATAGRIDVIEW.
2. EDITING A ROW .
3. UPDATING THE EDITED ROW TO DATABASE.
4. DELETING A PARTICULAR ROW FROM THE DATAGRIDIEW.
ALL THESE OPERATIONS SHOULD REFLECT DIRECTLY IN THE DATABASE.
IF SOMEONE CAN HELP IT WILL BE APPRECIABLE.
THANKS.
|
|
|
|
|
In visual studio you can change the settings of grid view control by checking the edit, new check boxes.
First do that and find how the coding got changed in code behind.
I think based on that you can make the changes for your project.
Even I am new to VB.net, but I think it helps you.
dil
|
|
|
|
|
Hi
Thanks for ur coments i'll try it and let u know.
|
|
|
|
|
I am a beginner at this, so please talk in SIMPLE terms. I'm trying to create a program based off an Access table (actually four) that will control the project numbers, assemblies, product numbers, and product details. I have four listboxes, at the top of the form, that display each of the areas. Each of them has a go button under them. Below that I have some textboxes, that I would ilke to use for manual entry, and a GO button. Below all that I have a picture box, five text boxes, and a multi-line textbox that will contain the description. I'd like to have it where you click on the last go button (after all the information has been entered), the info shows up below. The hard parts will be the listboxes at the top and making the textboxes display the correct information. I need the project numbers in the first one, and so on. I can put the program (or what I have of it) on an FTP site if needbe, but due to the sensitive nature of the database tables I cannot publish them. Thank you for your time.
-----------------------------
If at first you don't succeed, use more duct tape, a bigger hammer, or just don't fail in the first place!
|
|
|
|
|
Hi everyone
I have the folowing code in the Business class in my program, but when i run it says that there's an error in the sql. Can you please help
Public Function AddSale(ByVal dtDate As DateTime, ByVal bookcode As String, ByVal InvoiceNo As String, ByVal qty As Integer, ByVal subtot As Single, ByVal vat As Single, ByVal tot As Single) As String
Dim sql As String
Dim cmd As OleDb.OleDbCommand
Dim result As String = ""
Try
sql = "INSERT INTO SALES (Dates, BookCode, InvoiceNumber, Quantity, SubTotal, VAT, Total) Values ( " + dtDate + " ,'" + bookcode + "','" + InvoiceNo + "', qty , subtot, vat, tot)"
cmd = New OleDb.OleDbCommand(sql, con)
cmd.Parameters.Add(New OleDb.OleDbParameter("@qty", qty))
cmd.Parameters.Add(New OleDb.OleDbParameter("@subtot", subtot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@vat", vat))
cmd.Parameters.Add(New OleDb.OleDbParameter("@tot", tot))
cmd.Parameters.Add(New OleDb.OleDbParameter("@dtDate", dtDate))
If cmd.Connection.State = ConnectionState.Closed Then
cmd.Connection.Open()
End If
cmd.CommandText = sql
cmd.ExecuteNonQuery()
result = "true"
Catch ex As Exception
result = ex.Message.ToString()
End Try
Return result
End Function
|
|
|
|
|
When adding parameters, the parameter names in the SQL must match the parameters that you add: so your SQL should look like this:
sql = "INSERT INTO SALES (Dates, BookCode, InvoiceNumber, Quantity, SubTotal, VAT, Total) Values ( " + dtDate + " ,'" + bookcode + "','" + InvoiceNo + "', @qty , @subtot, @vat, @tot)"
You are also adding the date as a parameter "cmd.Parameters.Add(New OleDb.OleDbParameter("@dtDate", dtDate)) " after you have already embedded it in the SQL. So you may want to change your SQL to look something like this:
sql = "INSERT INTO SALES (Dates, BookCode, InvoiceNumber, Quantity, SubTotal, VAT, Total) Values ( @dtDate ,'" + bookcode + "','" + InvoiceNo + "', @qty , @subtot, @vat, @tot)"
And given that you are using parameters, you may want to add the BookCode as a paramter aswell, for consistency.
Hope this helps
|
|
|
|
|
G'Day,
I'm trying to set the row height for a custom / owner drawn list view control when displaying it in 'Details' view (not Large Icon). I have researched enough to think that I need to handle the WM_MEASUREITEM message that is sent to the parent of my list view. (The MSDN site indicated that the measure item message was sent to the parents wndproc.)
I hope this question isn't to vague for people, but I'm hoping someone can give me some direction in either an easier way of setting the ListView row height, or help me to understand the steps in capturing the correct messages to alter the row height.
I am currrently running VS.Net 2003
Thankyou in advance for any assistance.
bigjokey -(I'm not insinuating anything with my user name, it was a suggested name on hotmail)
|
|
|
|
|
I am not sure if a direct solution exist. You can create an empty imageList and set its height to what you want and add that imageList to the SmallImageList . We had to use this solution in our previous project, we couldn't come up with a way to do this and we never bothered to research further as this fixed it.
|
|
|
|
|
Thankyou T.R. That makes sense, I will give this a try.
|
|
|
|
|
Hi
I have a DataGrid on a Windows form and want to export the data of Datagrids to an Excel worksheet.
I'm beginner to VB.NET programming. I'd appreciate if somebody can help me.
hprasain
|
|
|
|
|
0.Add Excel Object Library 11 Refrence to your project which is a COM
1. Instatiate an Excel application:
dim xlApp as new Excel.Application
2.define an Excel worksheet
dim xlWRK as Excel.Worksheet
3.define an Excel workbook
dim xlWBK as Excel.Workbook
4.Open a workbook in the instantiated application:
xlWBK=xlapp.workbooks.open("YourFile")
5.Get the sheet on the workbook
xlWRK=xlwbk.worksheets(0)
6.Get the value on the worksheet
dim value as string = xlwrk.cells(1,1).value()
Note:Indexes of cells wil begin from 1
Note:Call xlapp.quit when you do not need the application(it may remain in the memory)
Note:You can view the excel application by changing the visible property of xlapp to true(xlapp.visible=true)
A.E.K
|
|
|
|
|
Thanks a lot!
To make your code work well I have to make a change on xlWRK=xlwbk.worksheets(0)
to xlWRK=xlwbk.worksheets(1).
Once more thanks a lot!!
|
|
|
|
|
I am trying to get a contextmenu to show when I right click on a datagrid.
This works fine as long as there is no text selected on the grid I am clicking; however as soon as there is any text selected in the part of the grid I right click - I get the usual undo, cut, copy, paste, delete, select all contextmenu - which I do not want.
I even set a break point in the sub below and I noticed that if any text is selected and the right mouse button is clicked the sub is not entered.
Can someone help me with this please?
Guy
Private Sub onmyDataGridMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown
Dim LocalMousePosition As Point
If e.Button = MouseButtons.Right Then
LocalMousePosition = DataGrid1.PointToClient(Cursor.Position)
ContextHandler("GridMenu")
DataGrid1.ContextMenu.Show(DataGrid1, New Point(LocalMousePosition.X,
LocalMousePosition.Y))
End If
End Sub
You always pass failure on the way to success.
|
|
|
|
|