|
Sir
I request you to sent me sample code of prime number, factorial, even and odd numbers in VB.Net/ASP.Net for an interview.
Regards
Lijo
|
|
|
|
|
what's that crap ????
if you cannot answer a question, don't spam the forum, especially when it is your second message on the forum, and when the 1st one was not that better...
people on CodeProject help because they want to ; no one owe nothing to anyone here, so if you're not satisfied, get out of here.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
For a what?? An interview? You want source code sent to you so you can answer question about it during an interview?
Guy, if you can't write simple algorithm like this yourself, don't even bother going to the interview! You'll embarass yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Tosser.
|
|
|
|
|
The problem is how to make use of relation between tables when I try to use parametrized query on the master table.
The code is like this:
1. Created data adapters
SqlDataAdapter1 - for first table, eg. PurchaseOrders with primary key PONum
SqlDataAdapter2 - for second table, eg. PurchaseOrderItems with primary key of two fields PONum<->POItemNum
2. Created data set
DataSet11 - for two related tables (one-to-many relation), joined by the key PONum
3. Filled the data set of data grid
SqlDataAdapter1.Fill(Me.DataSet11)<br />
SqlDataAdapter2.Fill(Me.DataSet11)
Then when I do not use the parametrized query the filling is done without errors. But when I modify SQL command of the SqlDataAdapter1 to use WHERE clause with parameter (eg. PO date) I get the error message. It cannot enforce constraints.
How to overcome this problem?
-- modified at 16:38 Monday 19th December, 2005
|
|
|
|
|
The coding shown below is my coding to select the largest integer in 'Inventno' field which have the same 'productCode'. say, I have 3 same items in the 'productCode' field but all of them have a different inventory number. my intention is to display the largest integer of a selected product code. the problem is there is nothing happen when i execute the coding n I dont know what went wrong.
Private Sub Command6_Click()<br />
Dim strSQL As String<br />
Dim conn As ADODB.Connection<br />
Dim rs As ADODB.Recordset<br />
<br />
Set conn = New ADODB.Connection<br />
Set rs = New ADODB.Recordset<br />
<br />
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\User\Desktop\IS\ISDB.mdb; Persist Security Info=False"<br />
<br />
conn.Mode = adModeRead<br />
conn.Open<br />
<br />
strSQL = "SELECT MAX(inventno) FROM IncomingStk WHERE ProductCode= '"&code.Text&"'"<br />
<br />
rs.Open (strSQL), conn<br />
conn.Close<br />
DataGrid1.Text = rs(0).Value<br />
<br />
Set rs = Nothing<br />
Set conn = Nothing<br />
<br />
End Sub
-- modified at 11:20 Sunday 18th December, 2005
|
|
|
|
|
Does the database table for ProductCode define that field as an int. if so, remove the single quote marks from you sql entry.
like:
strSQL = "SELECT MAX(inventno) FROM IncomingStk WHERE ProductCode =" & code.Text
also the way the your getting the value rs(0).value is not valid.
Should be
label.text = rs.Tables(0).Rows(0)(0).ToString().
This produces the value of row 1 col 1.
|
|
|
|
|
KaptinKrunch wrote: also the way the your getting the value rs(0).value is not valid.
Naw, this is vb6, rs(0).value is the equivalent of saying
rs.fields(0).value
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Well if I had to guess, then I would probably say your WHERE Clause is filtering out all of the results, so your getting a recordset with no records.
Also I just wanted to point out that while you close your data connection you forgot to close the recordset before setting it to nothing.
mellvincent wrote: DataGrid1.Text = rs(0).Value
Doesn't this set the data grids header text to that value (I don’t really remember)? Have you tried setting the text to a col - row first.
Or Set DataGrid1.DataSource = rs should also get the same results.
Hope this helps...
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Hi all,
I'd like to do a PDA programming in VB.NET. The Q is:
1. Is there any website where I can find details on PDA programming-from scratch (details of what software to be used, the installation, etc )?
TQ
-- modified at 10:30 Sunday 18th December, 2005
|
|
|
|
|
Visual Studio comes with tools to develop pocket PC applications. You can develop software for the PPC using the .NET Compact Framework, which is a cut down version of the full .NET Framework. Basically, certain things are removed (like ASP.NET since your PDA is most unlikely to be used as a web server) and some things are added - like support for an on-screen keyboard.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
hi i want to know to allocate the memory in vc6 globalalloc or malloc is used. how to allocate huge
memory to store the rgbvalues of bitmap in .net. what is name of that .net class. or how to do that
ddd
|
|
|
|
|
|
I have a number of forms (named as Employee1, Employee2 etc.), one for each of the employees, describing the details about them. Each of these forms is supposed to be opened based on a query. The idea is depicted in the following sample code:
Dim frm As New Form
Dim EmpID As Integer = 1 ' for example, only - actually coming from a query
frm.Name = "Employee" & CStr(EmpID)
frm.Text = "Employee ID: " & CStr(EmpID)
frm.ShowDialog()
The EmpID is actually coming from a query. The above piece of code opens a blank form, without taking into account the Name property of the form, which used to work fine in VB6 (as I remember).
An idea to solve this problem is appreciated.
|
|
|
|
|
You haven't said what the problem is. Of course, the code you posted will open a blank form. What do you want it to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry for lack of my expression. My problem is that the following expression
frm.Name = "Employee" & CStr(EmpID) 'EmpID comes from a query.
in my code results in opening a blank form instead of opening one of the existing ones.
The above expression is evaluated at run-time, which should open a different form based on the result of the query. It evaluates to a different form like Employee1, Emplyee99 etc. (just for example).
The reason for having a separate form for each employee is hard to explain but each of them is like a report of each individual. It is an assignment, which I have to accomplish.
Looking for further help, please.
|
|
|
|
|
It won't open an existing one. Your code starts by creating a new form, with no controls on it. Are you creating a form for every employee record?? Why?!?!?! There's no reason for it!
Take the data from the form and create a new instance of your employee form, modify the controls on it to display the data you want, then show that.
You can build a form name and try to show that, but it requires Reflection to do it. IMHO, a VERY overly convoluted solution to a simple problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi community,
I am new in programming withj VS2005.
So i am looking for help in prograaming with the dBase Datafiles (*.dbf)
Where i can find some links and code ?
Bye
Rainer
|
|
|
|
|
|
here is example
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_21649629.html
|
|
|
|
|
I experimenting with Writing database applications and trying to do different things with different controls. My current problem is I've been working on a feature to search a database containg my DVD collection. It is an Access 2003 Database with only one table. Here is my code thus far with the area where the program bombs in bold, any help would be greatly appreciated.Also the code that is supposed to check for a database is'nt working either, but I commented it out for now:
'Search<br />
<br />
'If they have no active dataset, refuse:<br />
<br />
'If ds.Tables.Count = 0 Then<br />
' MsgBox("Please use the file menu to open a dataset, or create <br />
'a new one first.")<br />
' Exit Sub<br />
'End If<br />
<br />
'search for the target in both columns, then display it<br />
<br />
Dim searchfor As String = InputBox("Enter you Search Term", "Search")<br />
<br />
searchfor = searchfor.ToLower<br />
lstResults.Items.Clear()<br />
<br />
Dim i, x, y, count As Integer<br />
<br />
dt = ds.Tables!DVDLIST ' set dt to point to this table<br />
<br />
TotalRows = dt.Rows.Count<br />
<br />
For i = 0 To TotalRows - 1<br />
x = ds.Tables(Name).Rows(i).Item(0).ToString.ToLower.IndexOf(searchfor) 'See if Title column matches<br />
<br />
y = ds.Tables(0).Rows(i).Item(1).ToString.ToLower.IndexOf(searchfor) 'see about desc column too<br />
<br />
If x <> -1 Or y <> -1 Then 'Match<br />
lstResults.Items.Add(ds.Tables(0).Rows(i).Item(0))<br />
'Add title field to a listbox<br />
count += 1<br />
<br />
End If<br />
<br />
Next i<br />
<br />
<br />
If count = 0 Then 'no matches found<br />
MsgBox("No match for " & searchfor & " was found...")<br />
Else<br />
lstResults.Visible = True<br />
End If
BINARY
|
|
|
|
|
I don't see a bold line.
Binary0110 wrote: searchfor = searchfor.ToLower
Is Access case sensitive ? SQL Server isn't.
Binary0110 wrote: ds.Tables!DVDLIST
What does this do ?
Binary0110 wrote: For i = 0 To TotalRows - 1
x = ds.Tables(Name).Rows(i).Item(0).ToString.ToLower.IndexOf(searchfor) 'See if Title column matches
y = ds.Tables(0).Rows(i).Item(1).ToString.ToLower.IndexOf(searchfor) 'see about desc column too
If x <> -1 Or y <> -1 Then 'Match
lstResults.Items.Add(ds.Tables(0).Rows(i).Item(0))
'Add title field to a listbox
count += 1
End If
Next i
This is definately not how to write a database. You may as well store your data in text files if you're not going to use SQL to search through your data.
"SELECT * from DVDList where title LIKE '%" + searchfor +"' OR desc LIKE '%" + searchfor + "'"
would generate you something that would have a good shot of giving you what you need. I suggest you google for "Access VB.NET Connection" and see what you come up with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I could barely work out what he was trying to do - got my 5 for the translation to SQL
/jason
|
|
|
|
|
Dear friends i`m going to develop a POKER game using VB.NET, but i don`t gave any idea about game programming using VB.NET, please suggest me some books for that , and also some helpful information and website links. It`s very urgent. Please help
dipankar
|
|
|
|
|
If you are only making a simple poker game, you really don't need to get all fancy and do tons of research. You have 52 cards in a deck. You can select at random a number 1-52, each number representing a different card (1-13 = ace-king hearts suit, 14-27 = ace-king spades suit, etc), and you store what cards you have out on a 2 dimensional array to show who has them. For four players (3,4), unless you are using more than 5 cards. Once you have that down, you are left with the graphics. You could use labels, picture boxes, but from your post, I assume you want to get really fancy.
http://www.microsoft.com/downloads/details.aspx?FamilyID=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en[^]
DirectX. I use it, but never really read any books on it, but I know tyhere is one out. You can make a fancy table object and use a cube object to handle the cards, just use different textures on them for different cards.
http://www.wings3d.com/[^]
^ is a good modeling program, but DirectX mainly users the .x or .m format, so you will have to convert your objects. Sorry I can't be of much help, but good luck.
|
|
|
|