fixo's Profile
Reputation: 83
Whiz
- Group:
- Active Members
- Active Posts:
- 335 (0.23 per day)
- Joined:
- 10-May 09
- Profile Views:
- 6,046
- Last Active:
Oct 25 2011 11:34 AM- Currently:
- Offline
Previous Fields
- Country:
- RU
- OS Preference:
- Who Cares
- Favorite Browser:
- Internet Explorer
- Favorite Processor:
- Intel
- Favorite Gaming Platform:
- PC
- Your Car:
- Ford
- Dream Kudos:
- 0
Latest Visitors
-
darek9576 
18 Dec 2012 - 17:33 -
CodingSup3rna... 
22 Nov 2012 - 10:34 -
GonSoft 
13 Feb 2012 - 10:39 -
scolty 
20 Jan 2012 - 08:06 -
NurulH 
15 Jan 2012 - 21:25
Posts I've Made
-
In Topic: Object reference not set to an instance of an object.
Posted 23 Sep 2011
Perhaps this will work on your end:
Dim xlApp As New Excel.Application Dim xlWorkbook As Excel.Workbook = Nothing Try xlApp.Visible = True xlWorkbook = xlApp.Workbooks.Open("C:\blah.xls") Catch...... -
In Topic: Datagridview Double Click with edit form
Posted 18 Sep 2011
Elda, on 17 September 2011 - 12:58 AM, said:Hello...
My Datagridview displays data perfectly. What I want is that
if I click or doubleclick cell of datagrid it will shows my
edit form...
code to displays data
sqlstmt = "SELECT * FROM GMOIR where " & cbfield.Text & " Like '%" & txtdata.Text & "%' " Dim cmd As New SqlCommand(sqlstmt, con2) da = New SqlDataAdapter(cmd) ds = New DataSet da.Fill(ds, "CB") t = ds.Tables(0) dgv1.DataSource = t
Anybody could give link or reference please?
Take a look at MSDN docs here:
http://msdn.microsof...oubleclick.aspx -
In Topic: NEED HELP IN VB.NET
Posted 13 Sep 2011
Just at the quick glance...
I see two fields in your update query: prodid and proid
Are the both identical?
Another point
I think you could't update primary key column value, but not sure about,
perhaps I don't understand your problem right
Anyway, you can try this query instead:
("UPDATE tblproduct SET (prodes = '" & txtdes.Text & "', price = '" & txtpr.Text & "', quantity = '" & txtquan.Text & "') WHERE ([color="#FF0000"]prodid[/color] = '" & txtid.Text & "')", "tblproduct") -
In Topic: Issues with the math.round function in VB.NET
Posted 13 Sep 2011
Take a look at String.Format method
This should do your work easily, e.g.,
{0:f3} format is means 3 decimals:
If ListBox1.Text = "Grammes (g)" And ListBox2.Text = "Ounces (oz)" Then douCalculatedValue = douinitialvalue * 0.0352739619 'douinitialvalue = douinitialvalue'<--this line is extrafluous 'Math.Round(douCalculatedValue, 3)'<--this line is extrafluous strOutput = String.Format(douinitialvalue & "g" & " = {0:f3} oz", douCalculatedValue) End If -
In Topic: dataViewGrid to text file
Posted 13 Sep 2011
Another way to write data from table based on
select query, something like this, if this would be interesting for you
Private Sub PullToCSV() Dim SqlSb As New SqlConnectionStringBuilder() SqlSb.DataSource = ".\SQLEXPRESS" '<--change here SqlSb.InitialCatalog = "Tester" '<--change here SqlSb.IntegratedSecurity = True SqlConn = New SqlConnection(SqlSb.ConnectionString) SqlConn.Open() Dim cmd As SqlCommand = SqlConn.CreateCommand() '' "Loan Balance" is with squared brackets here: Dim query As String = "Select [Month] " & _ "," & "'$'" & "+ convert(varchar,cast(Payment as money),1) as Payment" & _ "," & "'$'" & "+ convert(varchar,cast(Interest as money),1) as Interest" & _ "," & "'$'" & "+ convert(varchar,cast(Principal as money),1) as Principal" & _ "," & "'$'" & "+ convert(varchar,cast([Loan Balance] as money),1) as [Loan Balance]" & _ " FROM [Tester].[dbo].[Bank]" cmd.CommandText = query ''point of your interest: Using reader As SqlDataReader = cmd.ExecuteReader() Using swr As StreamWriter = New StreamWriter("myfile.xls") '<--write directly into the Debug folder i.e. ' 1. write swr.WriteLine("{0},{1},{2},{3},{4}", "Month", "Payment", "Interest", "Principal", "Loan Balance") '' If you use tab separated formatting, try next one instead: 'swr.WriteLine("{0}" & vbTab & "{1}" & vbTab & "{2}" & vbTab & "{3}" & vbTab & "{4}", "Month", "Payment", "Interest", "Principal", "Loan Balance") '2. write data While (reader.Read()) swr.WriteLine("{0},{1},{2},{3},{4}", reader("Month"), reader("Payment"), reader("Interest"), reader("Principal"), reader("Loan Balance")) '<--"Loan Balance" without squared brackets here '' If you use tab separated formatting, try next one instead: 'swr.WriteLine("{0}" & vbTab & "{1}" & vbTab & "{2}" & vbTab & "{3}" & vbTab & "{4}", reader("Month"), reader("Payment"), reader("Interest"), reader("Principal"), reader("Loan Balance")) End While swr.Close() End Using reader.Close() SqlConn.Close() End Using
My Information
- Member Title:
- D.I.C Regular
- Age:
- 61 years old
- Birthday:
- May 16, 1952
- Gender:
-
- Location:
- Pietari, Venäjä
- Years Programming:
- 6
- Programming Languages:
- VB.NET, VBA, C#, AutoLISP
Contact Information
- E-mail:
- Private
- Website URL:
-
http://
Friends
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
smohd
23 Jul 2011 - 16:16Just an idea, it's often best to let people work out their ideas as much as possible on their own,before giving them a worked-out plan or a complete working code.Developing a solution to a problem is something this fellow obviously needs to practice. Just something to consider next time.